A boilerplate for authoring npm modules, with tests and linting.
Well, let me tell you!
ava
andsinon
for testsnyc
for code coverageeslint-watch
for lintingnpm run
scripts for the above, so you won't have to install any global packages while authoring your module (I hate global modules, grr).travis.yml
for CI
npm run test
: Runs tests oncenpm run test:watch
: Runs tests in watch-modenpm run lint
: Lints the code oncenpm run lint:watch
: Lints the code in watch-modenpm run cover
: Runs code coverage usingnyc
(istanbul
)npm run coveralls
: Used by coverallsnpm run do-publish
: Used when publishing the package.
- Clone this repo, or download it as a zip
- If you decide to clone, remove the
.git
folder so you don't get unnecessary git history.
- If you decide to clone, remove the
- Find and replace all occurences of
npm-module-boilerplate
and replace it with your module name - filenames, too. You might also want to replacejeffijoe
with your own Github username... Probably the LICENSE.md as well. ๐ - Edit
package.json
,LICENSE.md
andREADME.md
for your own needs. npm install
and start coding! open 2 terminals, one for linting (npm run lint-watch
) and one for testing (npm run test-watch
) - at least that's what I do. ;)- Write your code in
lib/npm-module-boilerplate.js
(this is the main file) - Write your tests in
test/lib/npm-module-boilerplate.spec.js
(.. or, don't?) - Publish!
Jeff Hansen - @Jeffijoe