Yeoman generator for a JS boilerplate project
A boilerpate JS project structure, with babel-powered ES8 transpiling, eslint (with amazing settings provided by yours truly, pm2, nodemon, jest unit tests, ...
yarn add global generator-js-tiphedor
# or
npm i -g generator-js-tiphedor
yo js-tiphedor
The project ships with a couple of useful scripts that you can invoke with npm run <script>
or yarn <script>
. Thoses scripts are:
-
start
alias tostart:dev
-
start:dev
Runs the project in dev mode (usingbabel-node
, so with sub-optimal perfomances), watched bynodemon
-
start:prod
Runsbuild:prod
to transpile the code, then serves the app as a pm2 deamon (so with auto-restart, ...), and then attaches the logs of the app to the terminal.Ctrl-C
will only stop the logging, to stop the app usestop
-
stop
alias tostop:dev
-
stop:dev
stops the pm2 deamon -
build
alias tobuild:prod
-
build:prod
transpiles the ES8 code to standard JS, and places the result in thedist
folder. -
test
runstest:lint
andtest:unit
-
test:lint
runs eslint on the whole project -
test:unit
runs all the unit tests, located in./src/*.{test,spec}.js
. Saves the coverage info to./coverage