babel-plugin-transform-es2015-block-scoping
Compile ES2015 block scoping (const and let) to ES5
Last updated 2 years ago by hzoo .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install babel-plugin-transform-es2015-block-scoping 
SYNC missed versions from official npm registry.

babel-plugin-transform-es2015-block-scoping

Compile ES2015 block scoping (const and let) to ES5

Installation

npm install --save-dev babel-plugin-transform-es2015-block-scoping

Usage

Via .babelrc (Recommended)

.babelrc

Without options:

{
  "plugins": ["transform-es2015-block-scoping"]
}

With options:

{
  "plugins": [
    ["transform-es2015-block-scoping", {
      "throwIfClosureRequired": true
    }]
  ]
}

Via CLI

babel --plugins transform-es2015-block-scoping script.js

Via Node API

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

Options throwIfClosureRequired

In cases such as the following it's impossible to rewrite let/const without adding an additional function and closure while transforming:

for (let i = 0; i < 5; i++) {
  setTimeout(() => console.log(i), 1);
}

In extremely performance-sensitive code, this can be undesirable. If "throwIfClosureRequired": true is set, Babel throws when transforming these patterns instead of automatically adding an additional function.

Current Tags

  • 6.26.0                                ...           latest (2 years ago)
  • 7.0.0-beta.3                                ...           next (2 years ago)

51 Versions

  • 7.0.0-beta.3                                ...           2 years ago
  • 7.0.0-beta.2                                ...           2 years ago
  • 7.0.0-beta.1                                ...           2 years ago
  • 7.0.0-beta.0                                ...           2 years ago
  • 7.0.0-alpha.20                                ...           2 years ago
  • 6.26.0                                ...           2 years ago
  • 7.0.0-alpha.19                                ...           2 years ago
  • 7.0.0-alpha.18                                ...           2 years ago
  • 7.0.0-alpha.17                                ...           2 years ago
  • 7.0.0-alpha.16                                ...           2 years ago
  • 7.0.0-alpha.15                                ...           2 years ago
  • 7.0.0-alpha.14                                ...           2 years ago
  • 7.0.0-alpha.12                                ...           2 years ago
  • 7.0.0-alpha.11                                ...           2 years ago
  • 7.0.0-alpha.10                                ...           2 years ago
  • 7.0.0-alpha.9                                ...           2 years ago
  • 7.0.0-alpha.8                                ...           2 years ago
  • 6.24.1                                ...           3 years ago
  • 7.0.0-alpha.7                                ...           3 years ago
  • 7.0.0-alpha.3                                ...           3 years ago
  • 7.0.0-alpha.1                                ...           3 years ago
  • 6.23.0                                ...           3 years ago
  • 6.22.0                                ...           3 years ago
  • 6.21.0                                ...           3 years ago
  • 6.20.0                                ...           3 years ago
  • 6.18.0                                ...           3 years ago
  • 6.15.0                                ...           3 years ago
  • 6.14.0                                ...           3 years ago
  • 6.10.1                                ...           3 years ago
  • 6.10.0                                ...           3 years ago
  • 6.9.0                                ...           3 years ago
  • 6.8.0                                ...           3 years ago
  • 6.7.1                                ...           4 years ago
  • 6.7.0                                ...           4 years ago
  • 6.6.5                                ...           4 years ago
  • 6.6.4                                ...           4 years ago
  • 6.6.0                                ...           4 years ago
  • 6.5.0-1                                ...           4 years ago
  • 6.5.0                                ...           4 years ago
  • 6.4.0                                ...           4 years ago
  • 6.3.13                                ...           4 years ago
  • 6.2.4                                ...           4 years ago
  • 6.1.18                                ...           4 years ago
  • 6.1.17                                ...           4 years ago
  • 6.1.10                                ...           4 years ago
  • 6.1.5                                ...           4 years ago
  • 6.1.4                                ...           4 years ago
  • 6.0.18                                ...           4 years ago
  • 6.0.14                                ...           4 years ago
  • 6.0.9                                ...           4 years ago
  • 6.0.2                                ...           4 years ago
Downloads
Today 305
This Week 17,681
This Month 89,738
Last Day 8,831
Last Week 51,072
Last Month 216,572
Dependencies (5)
Dev Dependencies (1)
Dependents (358)

Copyright 2014 - 2016 © taobao.org |