Skip to content

Repository files navigation

Node.js TypeScript Template

A minimal Node.js template for building ESM applications with TypeScript 7, pnpm, tsx, oxlint, and oxfmt.

Features

  • TypeScript 7 with strict compiler settings
  • Native ESM output
  • Fast local development with tsx watch
  • Linting with oxlint
  • Formatting with oxfmt
  • pnpm package manager pinning via packageManager

Requirements

If pnpm is not installed, enable it with Corepack:

corepack enable pnpm

Getting Started

git clone https://github.com/sezRR/nodejs-typescript-template.git
cd nodejs-typescript-template
pnpm install

Scripts

Run the app in development mode with file watching:

pnpm dev

Build TypeScript from src/ into dist/:

pnpm build

Run the built app:

pnpm prod

Lint the project:

pnpm lint

Fix lint issues where possible:

pnpm lint:fix

Format files:

pnpm fmt

Check formatting without writing changes:

pnpm fmt:check

The pnpm test script is still the default placeholder and should be replaced when tests are added.

Project Structure

.
|-- src/
|   |-- helloWorld.ts
|   `-- index.ts
|-- .oxfmtrc.json
|-- .oxlintrc.json
|-- package.json
|-- pnpm-workspace.yaml
`-- tsconfig.json

Configuration

  • tsconfig.json compiles src/ to dist/ using ESNext modules, bundler module resolution, source maps, and strict type checking.
  • .oxlintrc.json enables oxlint with TypeScript, Unicorn, and OXC plugins.
  • .oxfmtrc.json configures oxfmt.
  • pnpm-workspace.yaml allows the esbuild build step used by dependencies and excludes TypeScript platform packages from the minimum release age rule.

About

Modern Node.js + TypeScript 7 template with ESM support, using tsx for fast development and bundler-style module resolution

Topics

Resources

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages