0.0.14 • Published 9 years ago
node-seed v0.0.14
node-seed
This project is a skeleton for a typical NodeJS application.
The idea is to group useful tools and good practices for every application is being developed in node.
How to use
- Clone this repository:
git clone https://github.com/hwndept/node-seed
- Remove .git directory
- Update package.json
- set "name"
- set "version"(0.0.0 by default)
- set "description"
- set "author"
- set "license"
- set right "keywords" or remove this section
- set your "repository" or remove this section
- set "buggs" or remove this section
- set "homepage" or remove this section
- Update README.md
- Update .travis.yml to use Travis as CI or remove it. repo_token used in config is the codeclimate's token. Every build on travis will report code coverage value to codeclimate.
What are included
- Code linter - jshint
- Code style checker - jscs
- Test runner - mocha;
- Test coverage checker - istanbul;
- Task manager - gulp;
- Pre-commit hook;
- JsDoc generation - jsdoc;
- ES6 Support(ECMA-262, Edition 5) - babel;
- Codeclimate integration codeclimate;
- TravisCI integation travis-ci;
Linting
gulp jshint
Code that will be validated:
- all *.js files in src folder
- all *.js files in test folder
- gulpfile.js
Checking code style
gulp jscs
Code that will be validated:
- all *.js files in src folder
- all *.js files in test folder
- gulpfile.js
Running tests and generating code coverage report
gulp test
Test cases stored in files test/**/*.test.js will be run only
Coverage reports will be generated and stored in folder build/coverage
Generating jsdoc
gulp jsdoc
Documentation will be generated for *.js files from src folder and stored in folder build/jsdoc
Compiling code - ES6 Support
Since nodejs doesn't fully support all ES6 features source code should be compiled.
gulp compile
Source code in src folder will be compiled and stored in folder build/source
Running all tasks
gulp
# or
gulp build
Pre-commit hook
This hook is invoked by git commit, and can be bypassed with --no-verify option.
The task gulp build will be run automatically.
Directory Layout
build/ --> build results
coverage --> code coverage reports
jsdoc --> documentation generated for source code
src/ --> source files for the application
hello.js --> added just for an example
test/ --> test files for the application
.jshintrc --> configuration file for jshint; these rules will
be applied for files in this folder only;
created because test cases contain global functions
which exports by mocha(describe, it,beforeEach, etc)
hello.test.js --> added just for an example
.jscsrc --> configuration file for jscs
.jshintrc --> configuration file for jshint
.travis.yml --> configuration file for travis-ci
gulpfile.js --> list of all gulp tasks