This repository serves as a starter template for building Node.js applications using TypeScript with Node.js 22's native TypeScript execution. It includes essential configurations and tools to streamline development and testing.
pnpm lint- Runs Prettier in check mode alongside the TypeScript compiler for type safety.pnpm format- Formats code using Prettier.pnpm typecheck- Executes the TypeScript compiler without emitting output.pnpm test- Executes tests using Vitest.
- Node.js 22 or later (for native TypeScript execution)
- pnpm package manager
The entry point for the application is src/index.ts. All TypeScript source files should reside in the src directory.
This template includes:
- TypeScript: For type-safe development with Node.js 22's native execution support.
- Vitest: A fast and lightweight testing framework.
- Dotenv: For managing environment variables via
.envfiles. - Prettier: For consistent code formatting.
- Native TypeScript Runtime: Run
.tsentrypoints directly with Node.js 22, no loader or build step required.
-
Install dependencies:
pnpm install
-
Run the example entrypoint:
node index.ts
-
Run tests:
pnpm test
| File/Folder | Description |
|---|---|
index.ts |
Entry point that leverages Node.js 22's native TypeScript execution. |
LICENSE |
License file for the project. |
package.json |
Contains project metadata and dependencies. |
README.md |
Project documentation. |
tsconfig.json |
TypeScript configuration tuned for modern Node.js ESM projects. |
vitest.config.ts |
Configuration for Vitest testing framework. |
vitest.setup.ts |
Setup file for Vitest tests. |
src/ |
All TypeScript source code goes here. |
Node.js 22 can parse and execute TypeScript files directly. This template leans on that capability so you can point node at any .ts entrypoint (such as the root index.ts) without an extra loader or compilation step.
Contributions are welcome! Feel free to open issues or submit pull requests to improve this template.