babel-preset-es2017
This is deprecated. If you want to stay up to date, use the env preset
This preset includes the following plugins:
Install
npm install --save-dev babel-preset-es2017
Usage
.babelrc
(Recommended)
Via .babelrc
{
"presets": ["es2017"]
}
Via CLI
babel script.js --presets es2017
Via Node API
require("babel-core").transform("code", {
presets: ["es2017"]
});
Basic Setup (with the CLI)
For more info, check out docs for babel-cli
Install the CLI and this preset
npm install --save-dev babel-cli babel-preset-es2017
Make a .babelrc config file with the preset
echo '{ "presets": ["es2017"] }' > .babelrc
Create a file to run on
echo 'async function a() {}' > index.js
Run it
./node_modules/.bin/babel-node index.js