Thank you for your interest in contributing to tiny-lru! This document outlines the process for contributing to the project.
This project follows the Contributor Covenant code of conduct. By participating, you are expected to uphold this code.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/tiny-lru.git - Install dependencies:
npm install - Create a branch:
git checkout -b feature/your-feature-name
npm installnpm test # Run lint and tests
npm run mocha # Run tests with coverage- Indentation: Tabs
- Quotes: Double quotes
- Semicolons: Required
- Formatting: Run
npm run fixbefore committing
npm run lint # Check linting and formatting
npm run fix # Fix linting and formatting issues- DRY (Don't Repeat Yourself): Extract common logic into reusable functions
- YAGNI (You Ain't Gonna Need It): Implement only what's needed
- SOLID: Follow single responsibility, open/closed, and interface segregation principles
- OWASP: Prioritize security; validate inputs, avoid unsafe operations
- All new features must include tests
- Maintain 100% line coverage
- Tests live in
tests/unit/ - Run
npm run mochato verify coverage
Follow conventional commits:
type(scope): description
[optional body]
[optional footer]
Types: feat, fix, docs, style, refactor, test, chore
Examples:
feat: add setWithEvicted method
fix: correct TTL expiration check
docs: update README API reference
- Ensure all tests pass:
npm test - Ensure 100% test coverage:
npm run mocha - Update documentation if needed
- Squash commits if necessary
- Submit pull request with clear description
- Tests pass with
npm test - 100% code coverage maintained
- Linting passes with
npm run lint - Documentation updated
- No breaking changes (or clearly documented)
Releases are managed by the maintainers. If you're preparing a release:
- Update version in
package.json - Update
CHANGELOG.md - Create release tag
Open an issue for any questions or discussions about contributions.
By contributing, you agree that your contributions will be licensed under the BSD-3-Clause license.