babel/packages/babel-plugin-transform-async-to-module-method
2016-06-28 19:16:44 -07:00
..
2015-10-29 17:51:24 +00:00
2016-05-02 19:43:49 -04:00

babel-plugin-transform-async-to-module-method

Turn async functions into a Bluebird coroutine

Installation

$ npm install babel-plugin-transform-async-to-module-method

Usage

.babelrc

// without options
{
  "plugins": ["transform-async-to-module-method"]
}

// with options
{
  "plugins": [
    ["transform-async-to-module-method", {
      "module": "bluebird",
      "method": "coroutine"
    }]
  ]
}

Via CLI

$ babel --plugins transform-async-to-module-method script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-async-to-module-method"]
});