A simple node js web application that includes various build, watch, testing processes though npm scripts.
The client
folder contains the js
and scss
to be build right to the build
folder. This is done also through an npm script (more below).
The scripts
folder is supposed to contain any scripts to be used from package.json
.
├── client
│ ├── js
│ └── scss
├── public
│ ├── css
│ ├── js
│ └── views
├── scripts
└── test
- Lifecycle scripts via
npm {script}
:
node app.js
tap test/test.hello.js
npm run lint
- Available via
npm run {script}
:
eslint **/*.js *.js
node-sass ./client/scss/main.scss ./public/css/main.css
browserify ./client/js/app.js | uglifyjs -mc > ./public/js/app.js
rimraf ./public/css/* && rimraf ./public/js/*
npm run build:clean
npm run build:sass && npm run build:js
watch 'npm run lint ' .
nodemon -q -x 'npm test '
nodemon --ignore client --ignore public app.js
nodemon --ignore $npm_package_config_ignoreClient --ignore $npm_package_config_ignorePublic app.js
watchify ./client/js/app.js -o ./public/js/app.js -dv
live-reload --port 2001 public/
npm run watch:test & npm run watch:server & npm run watch:browser
npm version major
npm version minor
npm version patch
echo 'Pushing code to git (master branch)'
git push --tags origin HEAD:master
npm test -s && npm run build -s && npm run version:patch && npm run push:origin
bash ./scripts/deploy.sh