babel/packages/babel-plugin-transform-es2015-for-of
Daniel Tschinder d9dd32860a Fix replacing for-of if inside label (#4736)
This replaces the label instead of the for-of itself as we already
integrate the label in the replacement nodes.
Fixes #3858
2016-10-17 17:27:13 -04:00
..
2016-05-02 19:43:49 -04:00

babel-plugin-transform-es2015-for-of

Compile ES2015 for...of to ES5

Installation

$ npm install babel-plugin-transform-es2015-for-of

Usage

.babelrc

// without options
{
  "plugins": ["transform-es2015-for-of"]
}

// with options
{
  "plugins": [
    ["transform-es2015-for-of", {
      "loose": true
    }]
  ]
}

Via CLI

$ babel --plugins transform-es2015-for-of script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-es2015-for-of"]
});