I'm writing a small CLI tool in node and would like to use ES6 for that.
index.js looks like:
#!/usr/bin/env node
require('babel/register');
module.exports = require('./app');
I can easily invoke that using
$ node index.js --foo some --bar thing
In my package.json
I declare the following:
"bin": {
"my-tool": "./index.js"
}
When installing and executing this it seems that babel is not working as I am getting:
/usr/lib/node_modules/my-tool/app.es6:1
(function (exports, require, module, __filename, __dirname) { import yargs fro
^^^^^^
SyntaxError: Unexpected reserved word
What is it that I am missing here?