Specially created for NodeJS NPM packages authoring
This boilerplate was created focused on authoring NodeJS NPM pakcages and CLI programs so you won't find any browser dependency like React.
- typescript TSC compiler is used for building your production code;
- also esbuild ⚡ is used for superfast buildings for debuging purposes (see VSCODE item below);
- test and ts-jest for unity testing
- eslint (google preset) and prettier
- lint-staged and husky for preventing not linted code commits;
- VSCODE is recomended if you wanna debug your code. This boilerplate is prepared to use VSCODE debugging tool. Just place your breakpoints and press F5.
- Clone
git clone https://github.com/carlosnakane/node-typescript-boilerplate.git
; - Use Yarn ot NPM to install dependencies
yarn
/npm install
; yarn start
/npm run start
for running the program from it's entrypoint (src/main.ts);- See the available scrips section for more tooling.
VSCODE debugging tools is fully configured to do the job. You just have to add your breakpoints and press F5
lint
: find for linting problems in your code;lint:fix
: do the same aslint
. Also fix all "autofixable" problems;build
: build your code to thedist
folder using TSC;build:debug
: fast build your code for debugging your code. You don't have to run this script for your own. VSCODE task will do it for you right after pressing F5;build:watch
: build and wait for code changes;test
: run the test suit against your code;test:coverge
: same above. Also show the istabull coverage report.
At the moment esbuild is a very experimental tool so I don't trust it for production yet. So the build script makes use of typescript TSC compiler