Skip to content
/ node-boilerplate Public template

Minimalistic boilerplate to quick-start Node.js development in TypeScript πŸš€

License

Notifications You must be signed in to change notification settings

RajaRakoto/node-boilerplate

Repository files navigation

node-boilerplate πŸš€

forthebadge forthebadge forthebadge forthebadge forthebadge

Git Gitub

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

πŸ“Œ Usage

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, ...).


πŸ“Œ NPM Scripts

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 like biome: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 and dev:nodemon:watch script are designed to run at the same time when developing your application.


πŸ“Œ Similar

You can also check out my other starter projects:

About

Minimalistic boilerplate to quick-start Node.js development in TypeScript πŸš€

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published