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.
- 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 "bugs" 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.
- Code linter - eslint;
- Test runner - jest;
- Test coverage checker - jest;
- Pre-commit hook;
- JsDoc generation - jsdoc;
- GitHub actions as CI;
- Editor Config editorconfig;
npm run lint
Code that will be validated:
- all *.js files in src folder
- all *.js files in test folder
- gulpfile.js
npm run tests
Test cases stored in files test/**/*.test.js will be run only
Coverage reports will be generated and stored in folder .build/coverage
npm run jsdoc
Documentation will be generated for *.js files from src folder and stored in folder .build/jsdoc
npm test
This hook is invoked by git commit, and can be bypassed with --no-verify option.
.build/ --> build results
coverage --> code coverage reports
jsdoc --> documentation generated for source code
.github/
workflows/
nodejs.yml --> The flows that runs automatic checks
config/
confih.yaml --> application configuration file
src/ --> source files for the application
services/
config.js --> configuration module
hello.js --> added just for an example
test/ --> test files for the application
integration/ --> integration tests
unit/ --> unit tests
.eslintrc.yaml --> configuration file for eslint; 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)
.editorconfig --> configuration file for code editors to keep style
.eslintrc.yaml --> configuration file for eslint