Boilerplate project for nodejs typescript
To use it as template of a project, click the button Use this template
.
Find and replace the word nodejs-ts-boilerplate
with <new-project-name>
. Most of the changes will be in README
file and project name
in package.json
file. IDE (e.g. vscode) is a good option to do that.
But you can also use the following command in terminal to replace nodejs-ts-boilerplate
with <new-project-name>
.
sed -i '' 's/nodejs-ts-boilerplate/<new-project-name>/g' *(.)
Docker build,
docker build . -t nodejs-boilerplate:0.1.0
Docker run,
docker run -it --rm -p 3000:3000 nodejs-boilerplate:0.1.0
Installs all the dependencies
Deletes the generated dist
folder.
Cleans the dist
folder first and then generates all the files.
Starts with cleaning the dist folder. It watches for file changes and recompiles on the go.
Cleans, generates and then starts using node dist/index.js
command
Runs the program using ts-node src
, ie, it does not require to generate all the dist
files
Runs in watch mode using nodemon
. Helpful for rapid development and testing.
Checks esLinter using google/gts
library.
Fixes linter errors using google/gts
library.
It first cleans dist
, generates dist
as part of pretest
, and then runs test
.
After finishing running, it checks lint as posttest
.