A minimal Node.js project template written in TypeScript, with formatting, linting, testing, and CI/CD ready to go.
- TypeScript library with ESM support and a CLI entry point using yargs
- pnpm as the package manager
- Formatting with Prettier and linting with ESLint
- Testing with Vitest — 100% code coverage required
- Pre-commit hooks with Lefthook — auto-formats and lints before each commit
- Dependabot — keeps GitHub Actions and npm dependencies up to date automatically
- CI workflow — validates the pre-commit hook on every pull request and push to
main
- Create a new repository from this template, or clone it directly.
- Install pnpm and run
pnpm installto set up project dependencies. - Install Lefthook and run
lefthook installto activate the pre-commit hook. - Replace the
LICENSEfile with your preferred license, or keep it to keep the project unlicensed. - Modify the template files to fit your project.
Each file is a starting point — modify it to fit your needs:
src/fibonacci.ts— replace the placeholder library with your own implementationsrc/index.ts— update the public API exports to match your librarysrc/cli/index.ts— replace the placeholder CLI, or remove it along with thebinentry inpackage.jsonif not neededsrc/cli/commands/— add or replace yargs command modules; each command is acreateXxxCommand()factory for testabilitypackage.json— update project name, description, version, and other metadata.prettierrc.json— adjust formatting optionseslint.config.ts— adjust linting rulesvitest.config.ts— adjust test configuration and coverage thresholdslefthook.yaml— add more pre-commit checks or other Git hooks.github/workflows/ci.yaml— extend or replace the CI workflow.github/dependabot.yaml— adjust update frequency or add more package ecosystemsCLAUDE.md— replace with guidance for your project's structure, tools, and development workflow (for Claude Code)