Hey there! 👋 This is my project template for Node.js projects. It is designed to provide a usable project skeleton with all of my linter rules, tooling, preferences etc. already in place, so I can spend more time building stuff, and less time setting it all up. It is provided in a fully documented state, with plenty of code comments, so that people who are unfamiliar with Node.js can see exactly what everything does.
- Initialise the project by cloning it into a new directory
- You may also want to purge this repositories
git
history before you start, you can do so withrm -rf .git
- You may also want to purge this repositories
- Copy
.env.example
to.env
and fill in the required variables - Run
npm install
to install the dependencies - Run
npm dev
to start thetsc
compiler andnodemon
in watch mode
This project requires at least Node.js v18. Always use the latest LTS version of Node.js when you can!
Version management configuration for Node.js is provided for volta
. I recommend you have this installed to automatically switch betIen Node.js versions when you enter one of our project directories. This allows for more deterministic and reproducible builds, which makes debugging easier.
You use volta
to configure the project to use the latest LTS version of Node.js by running:
volta pin node@lts
You can run this command again to update the version.
To install the dependencies:
npm install
You can then run the following to start the project in dev mode.
npm run dev
This runs the build:watch
and start:debug
commands at the same time.
You can run the following to only start the server in debug mode. This will also watch your files for changes, and reload the server when your files are saved.
npm run start:debug
You can also run the following to only start the compiler in watch mode.
npm run build:watch
You can also build the library without watching the directory:
npm run build
The tests for this library use Jest as the test runner. Once you've installed the dependencies, you can run the following command in the root of this repository to run the tests:
npm run test
This repo uses Semantic Versioning (often referred to as semver).
Thinking of contributing to this repo? Awesome! 🚀
Please follow the Contribution guide and follow the Code of Conduct.