Developer Ready: A comprehensive template. Works out of the box for most Node.js projects.
Instant Value: All basic tools included and configured:
- TypeScript 5.7+.
- Using Babel-node for transpilation.
- ESLint with some initial rules' recommendation.
- Jest for fast unit testing and code coverage.
- Type definitions for Node.js and Jest.
- Prettier to enforce consistent code style.
- NPM scripts for common operations.
- .editorconfig for consistent file format.
- Simple example of TypeScript code and unit test.
- Use all ES6 features (including experimental and proposal).
- Minimal
.envfiles for environment customization. - Clean imports: No relative files path.
- Zero dependencies: Install your own packages.
yarnPM by default.pm2as a process manager
🤲 Free as in speech: available under the APLv2 license.
This project is intended to be used with the latest Active LTS release of [Node.js][nodejs].
To start,
- Install PM2 process manager:
yarn global add pm2ornpm i -g pm2. - Clone this repository.
- Copy
.env.sampleto.env. - Install packages:
yarn installornpm i. - Start adding your code in the
srcand unit tests in the__tests__directories.
To clone the repository, use the following commands:
git clone https://github.com/jiifw/node-ts-boilerplate
cd node-ts-boilerplate
yarnDownload and unzip the current main branch or one of the tags:
wget https://github.com/jiifw/node-ts-boilerplate/archive/main.zip -O node-ts-boilerplate.zip
unzip node-ts-boilerplate.zip && rm node-ts-boilerplate.zipstart- serve built project.start:dev- interactive watch mode to automatically transpile source files.start:debug- interactive watch mode with debugger to automatically transpile source files.clean- remove coverage data, Jest cache, transpiled files and runtime files.prebuild- lint source files and tests before building.build- transpile TypeScript to ES6 (node compatible).build:prod- transpile TypeScript to ES6 for production (minified).lint- lint source files and tests.prettier- reformat files.test- run tests.test:watch- interactive watch mode to automatically re-run tests.pm2:start- PM2 specific start service(s).pm2:stop- PM2 specific stop service(s).pm2:delete- PM2 specific delete service(s).
This template uses native CommonJS.
Please do not open issues for questions regarding ESM or TS-Node on this repo.
Licensed under the APLv2. See the LICENSE file for details.