Thank you for your interest in contributing to binance-api-node! This document provides guidelines and instructions for contributing to the project.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/binance-api-node.git - Install dependencies:
npm install - Create a new branch for your feature or fix:
git checkout -b feature/your-feature-name
This project uses:
- Babel for transpiling ES6+ code to CommonJS
- AVA for testing
- ESLint for linting
- Prettier for code formatting
The following npm scripts are available for development and testing:
npm run build- Removes thedistfolder and transpiles thesrcdirectory todistusing Babelnpm run prepare- Automatically runs the build script (triggered on npm install)
npm test- Runs all tests (AVA tests + browser tests)npm run test:ava- Runs AVA tests with a 10-second timeout and verbose outputnpm run test:browser- Runs all browser tests (signature, crypto, and WebSocket tests)npm run test:browser:signature- Runs browser signature tests specificallynpm run test:browser:websocket- Runs WebSocket tests in the browser environmentnpm run test:browser:crypto- Runs cryptography tests in the browser environmentnpm run static-tests- Runs static tests only
npm run lint- Lints thesrcdirectory using ESLintnpm run prettier- Formats code insrcandtestdirectoriesnpm run prettier:check- Checks code formatting without making changesnpm run typecheck- Runs TypeScript type checking without emitting files
npm run cover- Runs tests with coverage using nycnpm run report- Generates coverage report and sends it to Coveralls
npm run ci- Runs the full CI pipeline (lint, prettier check, and all tests)
- Make your changes in the
srcdirectory - Add tests for any new functionality in the
testdirectory - Run
npm run lintto ensure code quality - Run
npm run prettierto format your code - Run
npm testto ensure all tests pass - Commit your changes with a clear commit message
This project uses ESLint and Prettier to maintain consistent code style. Before submitting a PR:
- Run
npm run prettierto format your code - Run
npm run lintto check for linting errors - Fix any issues that arise
- Write tests for all new features and bug fixes
- Ensure all tests pass before submitting a PR
- Tests should be placed in the
testdirectory - Browser-specific tests go in
test/browser - Use AVA's timeout option for tests that make API calls
- Update the README.md if you're adding new features or changing functionality
- Ensure all tests pass and code is properly formatted
- Update the documentation if necessary
- Submit a pull request with a clear description of your changes
- Reference any related issues in your PR description
Some tests require Binance API keys. You can:
- Create a
.envfile in the root directory - Add your API keys:
BINANCE_API_KEY=your_api_key_here BINANCE_API_SECRET=your_api_secret_here - Never commit your
.envfile or API keys to the repository
If you have questions about contributing, feel free to:
- Open an issue for discussion
- Check existing issues and pull requests for similar topics
- Review the README for API documentation and usage examples
By contributing to binance-api-node, you agree that your contributions will be licensed under the MIT License.