- Node.js >= 20
- Rust toolchain (see docs/BUILD.md)
- Git
-
Install dependencies
npm install
-
Build the project
npm run build
-
Run tests
npm testnpm testassumes the native addon is already built. If you changed Rust code (or need a fresh addon), run:npm run test:build
Use descriptive branch names:
feat/add-websocket-support- for new featuresfix/memory-leak-in-request- for bug fixesdocs/update-readme- for documentationrefactor/optimize-loader- for refactoringtest/add-integration-tests- for tests
Use Biome for formatting and linting:
# Check formatting and linting
npm run check
# Auto-fix formatting and linting issues
npm run check:fixFollow Conventional Commits:
feat: New featurefix: Bug fixdocs: Documentation changesrefactor: Code refactoringperf: Performance improvementstest: Adding or updating testsci: CI configuration changeschore: Other changes that don't modify src or test files
# Feature
feat(request): add support for HTTP/3
# Bug fix
fix(loader): resolve platform detection on Alpine Linux
# Documentation
docs(readme): add installation instructions for pnpm
# Breaking change
feat(api)!: change request signature to accept options object
BREAKING CHANGE: request() now requires an options object instead of positional arguments- Write tests for all new features
- Update tests when fixing bugs
- Use descriptive test names
// Good
test('should load correct binary for macOS ARM64', () => {
// ...
});
// Bad
test('test1', () => {
// ...
});# Run all tests (without rebuilding native addon)
npm test
# Build native addon + run all tests
npm run test:build
# Run specific test file
npm test -- path/to/test.spec.tsYour contributions make this project better for everyone. Thank you for taking the time to contribute! 🚀