Skip to content

Latest commit

 

History

History
72 lines (53 loc) · 2.35 KB

File metadata and controls

72 lines (53 loc) · 2.35 KB

Contributing Guide

Install

srv is developed and tested on NodeJS 6+, but is published via babel to work with v0.12+. Gulp is the build tool used for transpiling ES2015 and linting.

nvm is recommended for Node version management.

$ nvm use 6  # Optional.
$ git clone https://github.com/alfg/srv.git
$ npm install -g gulp
$ cd srv && npm install
$ gulp build && node build/srv examples/hello.js

nodemon is recommended for auto-restarting server on code changes during development. Then you can gulp watch to re-transpile code and nodemon will restart the server.

$ gulp watch  # Tab 1
$ nodemon build/srv examples/hello.js  # Tab 2

Contributing

A few simple rules to follow before sending any pull requests:

  • Document your code where necessary
  • Use simple, but descriptive commit messages
  • Lint and test your code
  • Feature Requests
  • Provide an example in examples/ if necessary
  • Provide tests for your code.
  • Lets try to keep srv a minimal footprint.
  • If you're unsure of adding an enhancement, fix or feature, feel free to submit an issue to ask.

EditorConfig

This project uses EditorConfig to maintain a consistent coding style.

Please install one of the plugins for your editor at: http://editorconfig.org/#download

Linting

This project follows the Airbnb Style Guide via ESLint using the eslint-config-airbnb-base package.

Run gulp lint to check for linting errors before sending a Pull Request.

Testing

Tests are written using ava and nyc for coverage.

Run npm test to run tests and output coverage report:

$ npm test

Write your tests in their respective test file:

  • test/api.js — API related tests.
  • test/cli.js — CLI related tests.

Resources