Skip to content

threeal/nodejs-starter

Repository files navigation

Node.js Starter

A minimal Node.js project template written in TypeScript, with formatting, linting, testing, and CI/CD ready to go.

What's Included

  • TypeScript library with ESM support and a CLI entry point using Commander.js
  • 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

Getting Started

  1. Create a new repository from this template, or clone it directly.
  2. Install pnpm and run pnpm install to set up project dependencies.
  3. Install Lefthook and run lefthook install to activate the pre-commit hook.
  4. Replace the LICENSE file with your preferred license, or keep it to keep the project unlicensed.
  5. Modify the template files to fit your project.

Customizing

Each file is a starting point — modify it to fit your needs:

  • src/lib.ts — replace the placeholder library with your own implementation
  • src/bin.ts — replace the placeholder CLI, or remove it along with the bin entry in package.json if not needed
  • package.json — update project name, description, version, and other metadata
  • .prettierrc.json — adjust formatting options
  • eslint.config.ts — adjust linting rules
  • vitest.config.ts — adjust test configuration and coverage thresholds
  • lefthook.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 ecosystems
  • CLAUDE.md — replace with guidance for your project's structure, tools, and development workflow (for Claude Code)

About

A minimal Node.js project template written in TypeScript, with formatting, linting, testing, and CI/CD ready to go.

Topics

Resources

License

Stars

Watchers

Forks

Contributors