A simple template to easily start Node Typescript project
I was basically using this template for myself, but I think it can be used by anyone who wants to start a typescript project without spending 10 years to configure it.
With that template, you can start coding instantly, that's cool no ? 😊
Finding new ways to be lazy is probably the most productive thing you've done
A developer citation for sure
Install dependencies, there is nothing more.
npm install
You can verify if everything is working with npm test
or npm start
The template integrates some basic tools to develop efficiently
It is very important to respect rules when coding.
I'm using eslint with airbnb rules, configure it to fits your needs
Type npm run lint
to show your error and npm run lint:fix
to fix simple one.
To separate coding rules and codeStyle, I use a prettier config. It's a very cool tool to formatting your code like your want
Test his code is essential, template integrated Jest test suites with typescript usage.
You can add new tests in the tests
folder.
Type npm run test
or npm run test:watch
to use it.
Watching more is very useful during test :)
Env
Work with an environment is sometime an obligation, especially when you build API with Docker and some secrets keys ect...
Set and set your config in .envrc
if you need some variables
Github
There is a .github
folder where you can write your Github Action and Github assets
You can also find .gitignore
. He's configure for node projects.
Hooks
To prevent you from commit / pushing bad code, husky is set to lint, build and run test on a commit.
If your work fails one of those steps, commit will be aborted 😠