This time with a template engine (Swig), Preact, unit tests, integration tests, code coverage, continuous integration, code analysis, code style and a nice setup flow.
Helper modules in use:
Jest A browser JavaScript testing toolkit. Jest is used by Facebook to test all JavaScript code including React applications. One of Jest's philosophies is to provide an integrated "zero-configuration" experience.
ESLint ESLint is a code style linter for programmatically enforcing your style guide.
Istanbul A Javascript code coverage tool written in JS.
Travis Travis CI is a hosted continuous integration service. It is integrated with GitHub and offers first class support for many languages.
Coveralls.io Coveralls is a web service to help you track your code coverage over time, and ensure that all your new code is fully covered.
Retire Scanner detecting the use of JavaScript libraries with known vulnerabilities.
$ npm install -g nodemon
$ npm install -g eslint
To run the server in development mode:
$ git clone https://github.com/5orenso/node-express-boilerplate.git
$ cd node-express-boilerplate
$ npm install
$ npm run start
Now you can browse your shiny new webpage. Open your favorite browser and navigate to one of these pages:
- http://localhost:8888/index.html
- http://localhost:8888/blog.html
- http://localhost:8888/readme
- http://localhost:8888/example/index.html
- http://localhost:8888/example/blog.html
- http://localhost:8888/example/readme
This will restart the server every time a file has changed.
In addition to this I recommend using Grunt to watch your files and perform code analysis and run tests every time a file changes:
$ ./run-watch.sh
Now, go ahead and add modules into the ./app/routes/web.js or add more routes to the ./app/server.js file.
$ npm test
$ open coverage/lcov-report/index.html
$ eslint --fix lib/utilities.js
- Bump version inside
package.json
- Push all changes to Github.
- Push all changes to npmjs.com:
$ bash ./npm-release.sh
.
# Install Node Security Platform CLI
$ npm install nsp --global
# From inside your project directory
$ nsp check
$ sudo npm install -g npm-check-updates
$ ncu -u -a
$ npm install --no-optional
For transparency and insight into the release cycle, releases will be numbered with the follow format:
..
And constructed with the following guidelines:
- Breaking backwards compatibility bumps the major
- New additions without breaking backwards compatibility bumps the minor
- Bug fixes and misc changes bump the patch
For more information on semantic versioning, please visit http://semver.org/.
We ❤️ contributions and feedback.
If you want to contribute, please check out the CONTRIBUTING.md file.
If you have any question or suggestion create an issue.
Bug reports should always be done with a new issue.