Developer Ready: A comprehensive template. Works out of the box for most Node.js projects. This project is intended to be used with the latest active LTS release of Node.js.
Instant Value - All basic tools included and configured:
- π Typescript >= 5.3
- π Node.js >= 20.10.0
- π§ Use Bun as package manager
- π ES
- π§ͺ Biome for code formatting and linting
- β Jest or Bun test for fast unit testing and code coverage
- π Type definitions for Node.js and Jest
- βοΈ EditorConfig for consistent coding style
- π¦ NPM scripts for common operations
- β‘ Reproducible environments thanks to Volta
- π οΈ Example configuration for GitHub Actions
- π Simple example of TypeScript code and unit test
- π Run tasks with Grunt (example for backup)
- π Build faster with ESBuild
- π₯οΈ Ungit for version control (git) with a GUI
- π Dotenv for environment variables
- π Nodemon for automatic restarts node server in development
- π Tsc-watch for automatic transpile source files in development
- π Runtime library for TypeScript helpers with tslib
- ποΈ Utility functions for working with ts-api-utils
To use this template, use the following commands:
bun create github.com/RajaRakoto/node-boilerplate <project-name>
cd <project-name>
bun run pkg-upgrade # to upgrade outdated dependencies in interactive mode
NOTE 1: I employ the
MIT license
for this starter kit, which includes my name and GitHub profile. Please remember to adjust or remove it if deemed unnecessary.
NOTE 2: In order to help you better understand the structure of this boilerplate, there is a
README.md
file in each subdirectory of src.
NOTE 3: For certain configurations in the
package.json
file, you need to modify them to tailor them to your project (e.g: name, description, author, keywords, main, repository, ...).
Start
- π
start
- Run your application with Node.js. - π
start:bundle
- Run your application with Node.js using the bundled JavaScript file from dist.
Clean
- π
clean
- Remove coverage data, prod, build.
Development
- π
dev:tsc:watch
- Interactive watch mode to automatically transpile source files with tsc-watch in development. - π
dev:nodemon:watch
- Interactive watch mode to automatically restart Node.js server in development with nodemon.
Build
- π
build
- Transpile TypeScript to ES6. - π
build:watch
- Interactive watch mode to automatically transpile source files . - π
build:bundle
- Bundle source files with ESbuild.
Testing
- π
test
- Run bun test. - π
test:watch
- Interactive watch mode to automatically re-run tests with bun.
Linting and Formatting
- π
biome:start
- Starts the Biome daemon server. You can specify a custom configuration file path using the--config-path
option. - π
biome:stop
- Stops the Biome daemon server. - π
biome:fix
- Runs a source code check and applies automatic fixes (linter & formatter) according to the defined rules. - π
biome:unsafe
- Works likebiome:fix
, but may apply more invasive or risky changes.
Backup and Dependency Management
- π
backup
- Backup files with Grunt. - π
pkg-check
- Check useless dependencies with depcheck. - π
pkg-upgrade
- Upgrade outdated dependencies (interactive mode) with npm-check-updates.
Versioning
- π
versioning
- Start ungit server.
NPM Commands
- π
npm-version:major
- Increments the major version number of your project using npm. - π
npm-version:minor
- Increments the minor version number of your project using npm. - π
npm-version:patch
- Increments the version patch number of your project using npm.
NVM
- π
nvm
- Manage multiple node.js versions. Easily switch between node versions per project to ensure compatibility.
NOTE:
dev.tsc.watch
anddev:nodemon:watch
script are designed to run at the same time when developing your application.
You can also check out my other starter projects:
- π bun-boilerplate
- π react-boilerplate
- π next-boilerplate
- π qwik-boilerplate
- π vscode-boilerplate
- π cli-boilerplate