Skip to content

A boilerplate for authoring npm modules, with tests and linting.

License

Notifications You must be signed in to change notification settings

jeffijoe/npm-module-boilerplate

Repository files navigation

npm-module-boilerplate

npm dependency Status devDependency Status Build Status Coveralls Code Climate npm npm node JavaScript Style Guide

A boilerplate for authoring npm modules, with tests and linting.

What's in the package?

Well, let me tell you!

  • ava and sinon for tests
  • nyc for code coverage
  • eslint-watch for linting
  • npm 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 scripts

  • npm run test: Runs tests once
  • npm run test:watch: Runs tests in watch-mode
  • npm run lint: Lints the code once
  • npm run lint:watch: Lints the code in watch-mode
  • npm run cover: Runs code coverage using nyc (istanbul)
  • npm run coveralls: Used by coveralls
  • npm run do-publish: Used when publishing the package.

Getting started

  1. 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.
  2. Find and replace all occurences of npm-module-boilerplate and replace it with your module name - filenames, too. You might also want to replace jeffijoe with your own Github username... Probably the LICENSE.md as well. 😄
  3. Edit package.json, LICENSE.md and README.md for your own needs.
  4. 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. ;)
  5. Write your code in lib/npm-module-boilerplate.js (this is the main file)
  6. Write your tests in test/lib/npm-module-boilerplate.spec.js (.. or, don't?)
  7. Publish!

Author

Jeff Hansen - @Jeffijoe

About

A boilerplate for authoring npm modules, with tests and linting.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published