babel-plugin-node-exports
v1.0.2
Published
Simplifies compiled CommonJS exports when working with node.
Downloads
4
Readme
babel-plugin-node-exports
Simplifies compiled CommonJS exports when working with node.
Installation
$ npm install babel-plugin-node-exports
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": ["babel-plugin-node-exports"]
}
Via CLI
$ babel --plugins node-exports script.js
Via Node API
require('babel').transform('code', {
plugins: ['node-exports']
});
Example
import goat from 'barn';
goat();
to:
var _barn = require('barn');
(0, _barn)();
(blame babel for redundant (0, ...)
If you need any other help, don't hesitate to leave an issue