1.0.1 • Published 5 years ago

babel-plugin-transform-node-module v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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 use module.exports instead of exports.
{
  "plugins": [
    ["transform-node-module", { "module": true }]
  ]
}

Via CLI

babel --plugins transform-node-module script.js