We welcome contributions to NB Scraper! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-scraper - Add your scraper following the established patterns in
app/scrapers/ - Add comprehensive tests in
tests/(opsional) - Update documentation and README
- Submit a pull request
- Create a new file in
app/scrapers/your-scraper.ts - Follow the existing patterns for type safety and error handling
- Add comprehensive TSDoc documentation
- Export your scraper from
app/scrapers/index.ts opsionalAdd tests intests/your-scraper.test.ts
Example scraper structure:
export async function yourScraper(
input: string,
options: YourScraperOptions = {}
): Promise<NBScraperResponse<YourScraperData>> {
try {
validateRequiredParams({ input }, ['input']);
// Your scraping logic here
const result = await makeRequest(config, options);
return createSuccessResponse(processedData);
} catch (error) {
return createErrorResponse(error as Error, { input });
}
}nb-scraper/
├── app/
│ ├── scrapers/ <!-- Lokasi utama scraper -->
│ │ ├── blackboxAi.ts
│ │ ├── threads.ts
│ │ ├── your-scraper.ts
│ │ └── index.ts <!-- File global ekspor -->
├── tests/
├── ...
- Node.js (v16 or higher)
- npm/yarn/pnpm
git clone https://github.com/chakszzz/nb-scraper.git
cd nb-scraper
npm installnpm run build # Build all formats
npm run build:cjs # Build CommonJS
npm run build:esm # Build ES Modules
npm run build:types # Build type definitionsnpm test # Run tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coveragenpm run lint # Check for linting errors
npm run lint:fix # Fix linting errorsnpm run docs # Generate documentation
npm run docs:serve # Serve documentation locally- Follow TypeScript best practices
- Use descriptive variable names
- Include comprehensive JSDoc comments
- Keep functions focused and modular
- Reference related issues
- Include tests for new features
- Update documentation as needed
- Keep commits atomic and well-described
Please use the GitHub issue tracker to report bugs or suggest features.