Thank you for your interest in contributing to precise-time-ntp! We welcome contributions from the community and are grateful for your support.
By participating in this project, you agree to abide by our Code of Conduct.
Before creating bug reports, please check existing issues to avoid duplicates. When creating a bug report, include:
- Clear title and description
- Steps to reproduce the behavior
- Expected behavior
- Actual behavior
- Environment details (Node.js version, OS, etc.)
- Code samples if applicable
We welcome feature suggestions! Please:
- Check if the feature has already been suggested
- Provide a clear description of the feature
- Explain why it would be useful
- Consider providing a simple implementation outline
- Fork the repository and create your branch from
main - Follow coding standards (see below)
- Add tests for new functionality
- Update documentation as needed
- Ensure tests pass by running
npm test - Create a pull request with a clear title and description
By submitting a pull request, you certify that you have the right to submit the contribution and that it may be distributed under the terms of the MIT License (inbound = outbound).
# Clone your fork
git clone https://github.com/your-username/precise-time-ntp.git
cd precise-time-ntp
# Install dependencies
npm install
# Run tests
npm test
# Run examples
npm run basic
npm run auto-sync
npm run websocket- Use camelCase for variables and functions
- Use PascalCase for classes
- Use UPPER_SNAKE_CASE for constants
- Use 2 spaces for indentation
- Use single quotes for strings
- Add JSDoc comments for public APIs
- Write tests for all new features
- Maintain or improve test coverage
- Use descriptive test names
precise-time-ntp/
├── index.js # Main library file
├── test.js # Test suite
├── package.json # Package configuration
├── README.md # Project documentation
├── LICENSE # MIT license
├── docs/ # Documentation files
│ ├── api-reference.md # API documentation
│ ├── quick-start.md # Getting started guide
│ └── ...
└── examples/ # Usage examples
├── basic.js # Basic usage
├── auto-sync.js # Auto-sync example
└── ...
When adding new features:
- Update the main
README.md - Add/update API documentation in
docs/api-reference.md - Create examples in the
examples/directory - Update JSDoc comments in the code
This project follows a minimal-dependency philosophy.
Policy:
- New runtime dependencies require explicit justification in the PR (security impact, maintenance status, license compatibility)
- Dependencies are pinned via
package-lock.jsonand must be committed with every change - Use
npm ci(notnpm install) in CI/CD to guarantee reproducible installs - Dependencies are tracked via
npm audit— any new high/critical vulnerability must be resolved before merging
Adding a dependency: