diff --git a/packages/babel-plugin-transform-async-to-module-method/README.md b/packages/babel-plugin-transform-async-to-module-method/README.md index 08179cebee..4d20674632 100644 --- a/packages/babel-plugin-transform-async-to-module-method/README.md +++ b/packages/babel-plugin-transform-async-to-module-method/README.md @@ -14,10 +14,21 @@ $ npm install babel-plugin-transform-async-to-module-method **.babelrc** -```json +```js +// without options { "plugins": ["transform-async-to-module-method"] } + +// with options +{ + "plugins": [ + ["transform-async-to-module-method", { + "module": "bluebird", + "method": "coroutine" + }] + ] +} ``` ### Via CLI diff --git a/packages/babel-plugin-transform-es2015-arrow-functions/README.md b/packages/babel-plugin-transform-es2015-arrow-functions/README.md index 4ae0a29cde..80a12d3d78 100644 --- a/packages/babel-plugin-transform-es2015-arrow-functions/README.md +++ b/packages/babel-plugin-transform-es2015-arrow-functions/README.md @@ -14,10 +14,18 @@ $ npm install babel-plugin-transform-es2015-arrow-functions **.babelrc** -```json +```js +// without options { "plugins": ["transform-es2015-arrow-functions"] } + +// with options +{ + "plugins": [ + ["transform-es2015-arrow-functions", { "spec": true }] + ] +} ``` ### Via CLI diff --git a/packages/babel-plugin-transform-es2015-classes/README.md b/packages/babel-plugin-transform-es2015-classes/README.md index 34d465b11e..ab9f4ce9d3 100644 --- a/packages/babel-plugin-transform-es2015-classes/README.md +++ b/packages/babel-plugin-transform-es2015-classes/README.md @@ -14,10 +14,20 @@ $ npm install babel-plugin-transform-es2015-classes **.babelrc** -```json +```js +// without options { "plugins": ["transform-es2015-classes"] } + +// with options +{ + "plugins": [ + ["transform-es2015-classes", { + "loose": true + }] + ] +} ``` ### Via CLI diff --git a/packages/babel-plugin-transform-es2015-computed-properties/README.md b/packages/babel-plugin-transform-es2015-computed-properties/README.md index 830b35204b..1501ec5b99 100644 --- a/packages/babel-plugin-transform-es2015-computed-properties/README.md +++ b/packages/babel-plugin-transform-es2015-computed-properties/README.md @@ -14,10 +14,20 @@ $ npm install babel-plugin-transform-es2015-computed-properties **.babelrc** -```json +```js +// without options { "plugins": ["transform-es2015-computed-properties"] } + +// with options +{ + "plugins": [ + ["transform-es2015-computed-properties", { + "loose": true + }] + ] +} ``` ### Via CLI diff --git a/packages/babel-plugin-transform-es2015-for-of/README.md b/packages/babel-plugin-transform-es2015-for-of/README.md index e0300c7e63..ec5840ffd8 100644 --- a/packages/babel-plugin-transform-es2015-for-of/README.md +++ b/packages/babel-plugin-transform-es2015-for-of/README.md @@ -14,10 +14,20 @@ $ npm install babel-plugin-transform-es2015-for-of **.babelrc** -```json +```js +// without options { "plugins": ["transform-es2015-for-of"] } + +// with options +{ + "plugins": [ + ["transform-es2015-for-of", { + "loose": true + }] + ] +} ``` ### Via CLI diff --git a/packages/babel-plugin-transform-es2015-modules-commonjs/README.md b/packages/babel-plugin-transform-es2015-modules-commonjs/README.md index 3ad1e4c355..95ea03c20f 100644 --- a/packages/babel-plugin-transform-es2015-modules-commonjs/README.md +++ b/packages/babel-plugin-transform-es2015-modules-commonjs/README.md @@ -12,10 +12,20 @@ $ npm install babel-plugin-transform-es2015-modules-commonjs **.babelrc** -```json +```js +// without options { "plugins": ["transform-es2015-modules-commonjs"] } + +// with options +{ + "plugins": [ + ["transform-es2015-modules-commonjs", { + "allowTopLevelThis": true + }] + ] +} ``` ### Via CLI diff --git a/packages/babel-plugin-transform-es2015-spread/README.md b/packages/babel-plugin-transform-es2015-spread/README.md index f5bdfc0c0a..62e9b385bf 100644 --- a/packages/babel-plugin-transform-es2015-spread/README.md +++ b/packages/babel-plugin-transform-es2015-spread/README.md @@ -14,10 +14,20 @@ $ npm install babel-plugin-transform-es2015-spread **.babelrc** -```json +```js +// without options { "plugins": ["transform-es2015-spread"] } + +// with options +{ + "plugins": [ + ["transform-es2015-spread", { + "loose": true + }] + ] +} ``` ### Via CLI diff --git a/packages/babel-plugin-transform-es2015-template-literals/README.md b/packages/babel-plugin-transform-es2015-template-literals/README.md index 07eccbc9ad..ef61c1b2a7 100644 --- a/packages/babel-plugin-transform-es2015-template-literals/README.md +++ b/packages/babel-plugin-transform-es2015-template-literals/README.md @@ -14,10 +14,21 @@ $ npm install babel-plugin-transform-es2015-template-literals **.babelrc** -```json +```js +// without options { "plugins": ["transform-es2015-template-literals"] } + +// with options +{ + "plugins": [ + ["transform-es2015-template-literals", { + "loose": true, + "spec": true + }] + ] +} ``` ### Via CLI diff --git a/packages/babel-plugin-transform-react-jsx/README.md b/packages/babel-plugin-transform-react-jsx/README.md index 51e996b841..7534e19486 100644 --- a/packages/babel-plugin-transform-react-jsx/README.md +++ b/packages/babel-plugin-transform-react-jsx/README.md @@ -14,10 +14,19 @@ $ npm install babel-plugin-transform-react-jsx **.babelrc** -```json +```js +// without options { "plugins": ["transform-react-jsx"] } +// with options +{ + "plugins": [ + ["transform-react-jsx", { + "pragma": "dom" // default pragma is React.createElement + }] + ] +} ``` ### Via CLI diff --git a/packages/babel-plugin-transform-regenerator/README.md b/packages/babel-plugin-transform-regenerator/README.md index d22e2292e9..0ee17fcf9f 100644 --- a/packages/babel-plugin-transform-regenerator/README.md +++ b/packages/babel-plugin-transform-regenerator/README.md @@ -1 +1,46 @@ # babel-plugin-transform-regenerator + +Transform async/generator functions with [regenerator](https://github.com/facebook/regenerator) + +## Installation + +```sh +$ npm install babel-plugin-transform-regenerator +``` + +## Usage + +### Via `.babelrc` (Recommended) + +**.babelrc** + +```js +// without options +{ + "plugins": ["transform-regenerator"] +} +// with options +{ + "plugins": [ + ["transform-regenerator", { + asyncGenerators: false, // true by default + generators: false, // true by default + async: false // true by default + }] + ] +} +``` + +### Via CLI + +```sh +$ babel --plugins transform-regenerator script.js +``` + +### Via Node API + +```javascript +require("babel-core").transform("code", { + plugins: ["transform-regenerator"] +}); +``` diff --git a/packages/babel-plugin-transform-runtime/README.md b/packages/babel-plugin-transform-runtime/README.md index 700676dee6..e09ec28c0c 100644 --- a/packages/babel-plugin-transform-runtime/README.md +++ b/packages/babel-plugin-transform-runtime/README.md @@ -14,10 +14,21 @@ $ npm install babel-plugin-transform-runtime **.babelrc** -```json +```js +// without options { "plugins": ["transform-runtime"] } + +// with options +{ + "plugins": [ + ["transform-runtime", { + "polyfill": false, + "regenerator": true + }] + ] +} ``` ### Via CLI diff --git a/packages/babel-plugin-transform-strict-mode/README.md b/packages/babel-plugin-transform-strict-mode/README.md index a47e06aa94..34f27d8f2a 100644 --- a/packages/babel-plugin-transform-strict-mode/README.md +++ b/packages/babel-plugin-transform-strict-mode/README.md @@ -14,10 +14,20 @@ $ npm install babel-plugin-transform-strict-mode **.babelrc** -```json +```js +// without options { "plugins": ["transform-strict-mode"] } + +// with options +{ + "plugins": [ + ["transform-strict-mode", { + "strict": true + }] + ] +} ``` ### Via CLI