a boilerplate for nom packages - for compile ES6 to ES5
npm install --save-dev babel-cli@6 babel-preset-es2015@6
create a script for build the package:
"scripts":{
"build": "babel src --presets babel-preset-es2015 --out-dir dist"
}
change main to "./dist/index.js" ~ or whatever other main file name you have
create a folder ./src/ and add your .js files to this directory
npm run build
npm publish