Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joutvhu/babel-plugin-transform-node-module
This plugin transforms ES2015 modules to Node.js module system.
https://github.com/joutvhu/babel-plugin-transform-node-module
Last synced: 16 days ago
JSON representation
This plugin transforms ES2015 modules to Node.js module system.
- Host: GitHub
- URL: https://github.com/joutvhu/babel-plugin-transform-node-module
- Owner: joutvhu
- License: mit
- Created: 2019-04-10T14:01:24.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-20T03:55:40.000Z (over 5 years ago)
- Last Synced: 2024-12-09T05:41:53.884Z (about 1 month ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# babel-plugin-transform-node-module
This plugin transforms ES2015 modules to Node.js module system.## Installation
```bash
npm install --save-dev babel-plugin-transform-node-module
```## Usage
### Via `.babelrc` (Recommended)
**.babelrc**
```json
{
"plugins": ["transform-node-module"]
}
```#### Options
- *`kind`* - A string value, specifying the type of variable used to import is "const", "let" or "var"..
```json
{
"plugins": [
["transform-node-module", { "kind": "const" }]
]
}
```- *`module`* - A boolean value, that if true will use `module.exports` instead of `exports`.
```json
{
"plugins": [
["transform-node-module", { "module": true }]
]
}
```### Via CLI
```bash
babel --plugins transform-node-module script.js
```