Skip to content

About

Node.js 24 template - tsgo, biome, vitest, runs .ts files directly using native type stripping

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

node24-template

A modern TypeScript project template for Node.js 24+. Uses Node's native type stripping to run .ts files directly — no build step required.

Stack

  • Runtime: Node.js >= 24 (ES modules, native TypeScript via type stripping)
  • Language: TypeScript 7 (strict mode, erasableSyntaxOnly)
  • Package Manager: pnpm 12
  • Linter/Formatter: Biome 2 (+ custom Grit plugins)
  • Test Runner: Vitest (V8 coverage)
  • Dependency rules: dependency-cruiser (parses TypeScript with @swc/core)
  • Type Checker: tsc (the native TypeScript 7 compiler)

Getting Started

pnpm install
pnpm start

Scripts

Command Description
pnpm dev Run the app in watch mode
pnpm start Run the app
pnpm check Lint, typecheck, v8-ignore, depcruise and tests on all files; coverage on changed files
pnpm check <filter> All checks, only for matching files
pnpm check:full All checks on all files, coverage included
pnpm full Same as check:full
pnpm all check:full + wet tests
pnpm fix Auto-fix lint/format issues
pnpm lint Lint and check formatting; warnings fail
pnpm typecheck Type-check with tsc
pnpm no-v8-ignore-in-tests No v8 ignore comments in test files
pnpm depcruise Validate module dependencies
pnpm test Run unit tests
pnpm test:changed Run unit tests on changed files
pnpm test:watch Run tests in watch mode
pnpm test:coverage [filter] 100% coverage + colocated test; changed or matching files
pnpm test:coverage:all Same, all files
pnpm test:update <filter> Update snapshots of matching tests
pnpm wet Run integration ("wet") tests — *.wet.test.ts
pnpm biome:migrate Migrate biome.jsonc after a Biome upgrade

<filter>: path substring in src/ or tooling/, extension optional. add and src/add.ts both match src/add.ts and src/add.test.ts. A type error or a dependency violation in another file does not fail a filtered check.

Check tooling: TypeScript in tooling/, same rules as src/ (lint, tests, 100% coverage). Commands are tooling/bin/*.ts; scripts set NODE_COMPILE_CACHE (cache in node_modules/.cache) for faster start-up.

Entry files (src/index.ts, tooling/bin/*.ts) only wire modules: no logic (Biome plugin) and no test (coverage check). New entry pattern: update tooling/files/is-entry-file.ts, .dependency-cruiser.mjs and the no-logic-in-entry-file.grit includes in biome.jsonc.

Project Structure

The src/ directory contains example code to demonstrate the setup — replace it with your own:

src/
├── index.ts                      # Entry point
├── types.ts                      # Shared types
├── services/
│   ├── add.ts                    # Example service
│   ├── add.test.ts               # Example test
│   ├── package-name.ts           # Example service with I/O
│   ├── package-name.test.ts      # Unit test: readFile passed in
│   └── package-name.wet.test.ts  # Wet test: real package.json
└── utils/
    ├── logger-creator.ts         # Creates the logger: logger("message")
    └── logger-creator.test.ts    # Example test with an injected write

About

Node.js 24 template - tsgo, biome, vitest, runs .ts files directly using native type stripping

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages