A yeoman generator for npm modules
Make sure you have yeoman installed:
$ npm install -g yo
Then clone the module into your global node_modules directory, then use it with yeoman:
$ yo npm
The generator creates a directory structure like so:
.eslintrc
.jscsrc
Makefile
package.json
README.md
lib/
test/
tools/
The purpose of each of the directories are:
lib/
module source codetest/
test filestools/
githooks and other scripts
The generated Makefile supports all the following targets, and they can be
listed by running make
:
$ make
clean Cleans unit test coverage files and node_modules.
codestyle-fix Run code style checker (jscs) with auto whitespace fixing.
codestyle Run code style checker (jscs).
coverage Run unit tests with coverage reporting. Generates reports into /coverage.
githooks Install git pre-push hooks.
lint Run lint checker (eslint).
nsp Run nsp. Shrinkwraps dependencies, checks for vulnerabilities.
prepush Git pre-push hook task. Run before committing and pushing.
test Run unit tests.
Add unit tests for any new or changed functionality. Ensure that lint and style checks pass.
To start contributing, install the git prepush hooks:
make githooks
Before committing, run the prepush hook:
make prepush
If you have style errors, you can auto fix whitespace issues by running:
make codestyle-fix
Copyright (c) 2016 Alex Liu
Licensed under the MIT license.