npm-lib-boilerplate
v1.0.1
Published
Starter kit to build NPM modules with ease
Downloads
8
Maintainers
Readme
npm-lib-boilerplate
This project provides the boilerplate code needed for making an NPM module.
Usage
- Fork this repository to your git account
- Change remote set URL to your own repository
- Change package.json, readme.md and license with your project relevant information
- Replace contents in src/data.json, src/index.js and src/index.test.js as per your requirements
- Install dependencies
npm install
Dependencies
Modules for development
- Transpiler:
- "babel-cli" -> Command Line Interface for Babel (Convert ES6 -> ES5)
- "babel-loader" -> Babel Module Loader for Webpack
- "babel-plugin-istanbul" -> Babel plugin to add Istanbul Instrumentation to ES6
- "babel-preset-es2015" -> Babel preset for all ES6 plugins
- "babel-register" -> Babel require hook
- Testing:
- "chai" -> Test framework agnostic BDD/TDD assertion library
- "mocha" -> Light-weight JS test framework
- "nyc" -> Command Line Interface for Istanbul (Code coverage instrument) (Configuration : .nycrc)
- "codecov" -> Upload code coverage report to Codecov
- Linting:
- "eslint" -> AST based pattern checker for JavaScript
- Package Manager:
- "webpack" -> pack commonJS/AMD modules for browser
- "json-loader" -> JSON loader module for Webpack
- Release Automation:
- "ghooks" -> set Git hooks for automation
- "commitizen" -> Git commit message with standard convention format
- "cz-conventional-changelog" -> commitizen adapter for conventional changelog format
- "validate-commit-msg" -> validate commit message as per conventional changelog standard
- "semantic-release" -> automated NPM package publisher
- Utilities:
- "rimraf" -> deep deletion module platform-independent
- "cross-env" -> set node environment variables platform-independent
- "npm-run-all" -> Command Line Interface to run multiple npm-scripts in parallel or sequential
Configuration Files
- .travis.yml -> automation script for Travis CI
- .babelrc -> options to configure Babel Transpiler
- .nycrc -> options to configure Istabul Code Coverage Reporter
- .eslintrc -> options for ES Lint checking tool
- test/mocha.opts -> options for mocha test framework
- webpack.config.babel.js -> options for Webpack module bundler
- .gitattributes -> attributes to configure git
- .gitignore -> ignore generated files and folders
Generated Files
- .nyc_output/ -> garbage output from istanbul instrumentation
- node_modules/ -> npm modules installation directory
- coverage/ -> lcov report for istanbul code coverage
- dist/ -> output files for ditribution