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
eslint
andprettier
- Unit tests
- Logs with
winston
- Git
pre-commit
andpre-push
hooks - 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:once
run in development modetest
run unit test
You can use dev:watch
or test:watch
for hot reloading.
build
compile code to javascriptstart
run in production mode (NODE_ENV
needs to be set)lint
lint 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
test
directory instead of having my test files next to the code files?
A - Editjest.config.js
roots field,nodemon.json
watch field andtsconfig.production.json
exclude 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-commit
andpre-push
scripts inpackage.json