Skip to content

the-redback/nodejs-ts-boilerplate

Repository files navigation

nodejs-ts-boilerplate

Boilerplate project for nodejs typescript

License GitHub Actions GitHub Actions Docker Known Vulnerabilities TypeScript Style Guide code size


Use As Template

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

Docker build,

docker build . -t nodejs-boilerplate:0.1.0

Docker run,

docker run -it --rm -p 3000:3000 nodejs-boilerplate:0.1.0

Yarn Commands

yarn or yarn install

Installs all the dependencies

yarn clean

Deletes the generated dist folder.

yarn build

Cleans the dist folder first and then generates all the files.

yarn build:w

Starts with cleaning the dist folder. It watches for file changes and recompiles on the go.

yarn start

Cleans, generates and then starts using node dist/index.js command

yarn start:dev

Runs the program using ts-node src, ie, it does not require to generate all the dist files

yarn start:w

Runs in watch mode using nodemon. Helpful for rapid development and testing.

yarn lint

Checks esLinter using google/gts library.

yarn fmt

Fixes linter errors using google/gts library.

yarn test

It first cleans dist, generates dist as part of pretest, and then runs test. After finishing running, it checks lint as posttest.

About

Boilerplate project for nodejs typescript. This template utilizes `google/gts` for esLinter check, fixing it, and to delete `dist` folder.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published