Just like babel-node, but using babel-register. So you could use it in production.
- You should not be using
babel-node
in production. https://babeljs.io/docs/usage/cli/ babel-register
is fussy. See below for detail.
// index.js
require('babel-register');
require('./my-es6.js');
node index.js
babel-register my-es6.js
Just the same with node
.
Using npm:
$ npm install babel-register-cli -g
MIT