hwndept / node-seed

This project is a skeleton for a typical NodeJS application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm dependencies npm dev dependencies

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

  1. Clone this repository: git clone https://github.com/hwndept/node-seed
  2. Remove .git directory
  3. 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
  1. Update README.md
  2. 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 - eslint;
  • Test runner - jest;
  • Test coverage checker - jest;
  • Pre-commit hook;
  • JsDoc generation - jsdoc;
  • GitHub actions as CI;
  • Editor Config editorconfig;

Linting

npm run lint

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

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

Generating jsdoc

npm run jsdoc

Documentation will be generated for *.js files from src folder and stored in folder .build/jsdoc

Running all tasks

npm test

Pre-commit hook

This hook is invoked by git commit, and can be bypassed with --no-verify option.

Directory Layout

  .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

About

This project is a skeleton for a typical NodeJS application

License:MIT License


Languages

Language:JavaScript 100.0%