Boilerplate for Creating ES6 NPM Modules

I just wanted to pass on a gem that I found while creating a new NPM module.

Using ES6 in NPM modules can be quite a pain but this will setup

  • Babel
  • Mocha
  • ESLint
  • Travis (though I used Codeship)
  • Istanbul (code coverage checker)
  • and of course an npm build and prepublish commands to compile it before submitting to NPM.

Using NPM for private modules is going to be a really big win moving forward… this allows for really easy sharing across multiple apps


This is cool. Note that the recommended babelrc is a little different, though, for Meteor. That thread also mentions a few quirks where things will be a little different from standard Meteor behavior.

  • you can’t use absolute import paths
  • any global declarations will fail in mocha (although you can set window.myGlobal inside a Meteor.isClient block).
  • you can’t do nested imports
1 Like

Ah great to know! thanks!! Perhaps someone can make a Meteor fork :smiley:

1 Like

I made one for the Meteor app itself, but I didn’t put code coverage in for the time being. The other branches are for angular2, react and plain blaze. Though I did add JSDoc.

1 Like