Boilerplate for creating npm packages with ES6. Deprecated in favour of new modern-package-boilerplate. Features: webpack2, babel, mocha, chai, sinon, istanbul, eslint, CI with travis-ci.org, coverage reports with coveralls.io

Usage no npm install needed!

<script type="module">
  import testPackageEs6 from 'https://cdn.skypack.dev/test-package-es6';



In favour of modern-package-boilerplate

Build Status Coverage Status dependencies Status devDependencies Status


Getting started

  1. Clone this repo from github
  2. Inside repo directory run npm install && rm -r .git && git init
  3. Update package.json with your information



npm run clean

Delete all cache and output files

npm run dev

Build your library in development mode

npm run build

Build your library in production mode

npm run test

Run tests

npm run test:watch

Run tests in watch mode

npm run cover

Cover your code (Work with ES6)

npm run coveralls

Sends coverage details to coveralls.io. Used in .travis.yml and should not be used manually.

npm run lint

Check your code for errors and code styles

npm run prepublish

Hook for npm, that executes when you publishing package in npm repository.


This boilerplate uses air-bnb code style conventions, however if you don't like it, you can disable it, by removing the following line in .eslintrc config file:

  "extends": "airbnb"

Webpack aliases

If you are as tired as me to write '../../../' in the require statements, you can use alias feature provided by webpack. Here is an example of aliases, built in this boilerplate by default (builder/resolve.js):

resolve: {
    alias: {
        Src: path.resolve(process.cwd() + '/src'),
        Lib: path.resolve(process.cwd() + '/lib')

Feel free to add your custom aliases, they are awesome.