Latest preset

All you need to compile what's in ES2015+

Also check out preset-env!

This is a special preset that will contain all yearly presets so user’s won’t need to specify each one individually.

It currently includes:

Basic Setup (with the CLI)

For more info, check out the setup page on the cli and the usage docs.

Install the CLI and this preset

npm install --save-dev babel-cli babel-preset-latest

Make a .babelrc config file with the preset

echo '{ "presets": ["latest"] }' > .babelrc

Create a file to run on

echo 'console.log(1 ** 2)' > index.js

Run it

./node_modules/.bin/babel-node index.js

Install

npm install --save-dev babel-preset-latest

Usage

.babelrc

{
  "presets": ["latest"]
}

Via CLI

babel script.js --presets latest

Via Node API

require("babel-core").transform("code", {
  presets: ["latest"]
});

Options

es2015

boolean, defaults to true.

Toggles including plugins from the es2015 preset.

{
  "presets": [
    ["latest", {
      "es2015": false
    }]
  ]
}

You can also pass options down to the es2015 preset.

{
  "presets": [
    ["latest", {
      "es2015": {
        "modules": false
      }
    }]
  ]
}

Note: This also works for the other preset-year options below.

es2016

boolean, defaults to true.

Toggles including plugins from the es2016 preset.

es2017

boolean, defaults to true.

Toggles including plugins from the es2017 preset.