This is a template project made for your needs!
Fork me and save a ton of time on boilerplate and environment bootstrapping!
Meant to be used by projects running
node.js
- Typescript
- Configuration
- Linting with
eslintandprettier - Unit tests
- Logs with
winston - Git
pre-commitandpre-pushhooks - Hot reloading
Just fork this project into another one, change the relevant fields (everything in <this-format>) in package.json and package-lock.json and you're good to go!
dev:oncerun in development modetestrun unit test
You can use dev:watch or test:watch for hot reloading.
buildcompile code to javascriptstartrun in production mode (NODE_ENVneeds to be set)lintlint code files
To run in production mode just set NODE_ENV to your desired environment then run npm run build && npm start.
This is a very powerful toll, however it is reasonable it won't satisfy every single one of your needs.
I highly recommend forking this repository and editing it's settings or adding more instead of creating a new project from scratch.
Q - How should I name my test files?
A -some-name.spec.ts
Q - What if I want to add a
testdirectory instead of having my test files next to the code files?
A - Editjest.config.jsroots field,nodemon.jsonwatch field andtsconfig.production.jsonexclude field accordingly.
Q - Do I really need to go over all the fields in
package-lock.json?
A - No, just change the name field in line 2
Q - How do I change the pre commit and pre push git hooks?
A - Change thepre-commitandpre-pushscripts inpackage.json