A minimalistic template for starting a new Node.js project.
This template provides a basic Node.js project containing a sample library written in TypeScript, with support for formatting, linting, testing, and continuous integration.
- Minimal Node.js project written in TypeScript with ESM support.
- Uses pnpm as the package manager.
- Supports formatting with Prettier, linting with ESLint, and testing with Vitest.
- Fixes formatting and linting during pre-commit hooks using Lefthook.
- Preconfigured workflows for Dependabot and GitHub Actions.
This guide explains how to use this template to start a new Node.js project, from creation to release.
Follow this link to create a new project based on this template. For more information about creating a repository from a template on GitHub, refer to this documentation.
Alternatively, you can also clone this repository locally to begin using this template.
By default, this template is unlicensed. Before modifying this template, it is recommended to replace the LICENSE file with the license that will be used by the new project. For more information about licensing a repository, refer to this documentation.
Alternatively, you can remove the LICENSE file or leave it as is to keep the new project unlicensed.
To replace the sample information in this template with your new project information, complete the following steps:
- Replace the content of this
README.mdfile with a description of the new project. For more information on adding READMEs to a project, refer to this documentation. - Update project information in the
package.jsonfile. For more details on thepackage.jsonschema, refer to this documentation.
This template uses pnpm as the package manager. If pnpm is not installed, follow this guide to install it. Then, install the project dependencies with:
pnpm installFor more information on pnpm, including adding dependencies or running tools, refer to this documentation.
This template provides two components: the library itself (src/lib.ts) and an executable entry point (src/bin.ts). Write code according to your project requirements. If you're new to TypeScript, refer to this documentation for guidance.
If your project doesn’t need an executable, you can remove src/bin.ts and the bin entry from the package.json file.
Test files in this template are named *.test.ts and typically correspond to the source files being tested. This template uses Vitest as the testing framework. For more information on testing with Vitest, refer to this documentation.
After creating your test files, run tests with:
pnpm testWhen the project is complete, package the library by running:
pnpm packThis will create a tarball file, which can be included in the release. Ensure the project is at the correct version and has been pushed to the upstream repository. For more information on releasing a project, refer to this documentation.