babel-plugin-transform-node-module
v1.0.1
Published
This plugin transforms ES2015 modules to Node.js module system.
Downloads
56
Maintainers
Readme
babel-plugin-transform-node-module
This plugin transforms ES2015 modules to Node.js module system.
#Installation
npm install --save-dev babel-plugin-transform-node-module
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": ["transform-node-module"]
}
Options
kind
- A string value, specifying the type of variable used to import is "const", "let" or "var"..
{
"plugins": [
["transform-node-module", { "kind": "const" }]
]
}
module
- A boolean value, that if true will usemodule.exports
instead ofexports
.
{
"plugins": [
["transform-node-module", { "module": true }]
]
}
Via CLI
babel --plugins transform-node-module script.js