base-module
v0.1.3
Published
Use this Base Module to create your own NPM module.
Downloads
5
Readme
Base Module
Use this Base Module to create your own NPM module.
Features
- Linting according Airbnb JavaScript Style Guide
- Support and compilation of ES6 code
- Unit tests with Mocha, Chai and Sinon
- Test coverage check with Istanbul / NYC
Workflow
Preparation
- Install Node.js
- Install Atom text editor
- Install Atom package linter-eslint and its dependencies
Setup
- Get available module name by testing
https://www.npmjs.com/package/<module-name>
- Create module folder with
mkdir <module-name>
- Open module folder with
cd <module-name>
- Create empty package.json file with
echo '{}' > package.json
- Install Base Module with
npm install --save-dev base-module
Development
- Follow Test Driven Development
- Follow the Airbnb JavaScript Style Guide
- Edit your code in src folder only
- Edit your tests in test folder only
Testing
- Run
npm test
to run all tests once- Run
npm run test-eslint
to run code tests once - Run
npm run test-mocha
to run unit tests once - Run
npm run test-mocha-watch
to run continuous unit tests- Run
CTRL + C
to stop the continuous unit tests
- Run
- Run
Compiling
- Run
npm run build
to compile ES6 code to ES5 code in folder lib