babel-plugin-transform-async-to-module-method
Turn async functions into a module method
Last updated 3 years ago by hzoo .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install babel-plugin-transform-async-to-module-method 
SYNC missed versions from official npm registry.

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

Turn async functions into a Bluebird coroutine

Example

In

async function foo() {
  await bar();
}

Out

var Bluebird = require("bluebird");

var foo = Bluebird.coroutine(function* () {
  yield bar();
});

Installation

npm install --save-dev babel-plugin-transform-async-to-module-method

Usage

Via .babelrc (Recommended)

.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"]
});

Current Tags

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

38 Versions

  • 7.0.0-beta.3                                ...           3 years ago
  • 7.0.0-beta.2                                ...           3 years ago
  • 7.0.0-beta.1                                ...           3 years ago
  • 7.0.0-beta.0                                ...           3 years ago
  • 7.0.0-alpha.20                                ...           3 years ago
  • 7.0.0-alpha.19                                ...           3 years ago
  • 7.0.0-alpha.18                                ...           3 years ago
  • 7.0.0-alpha.17                                ...           3 years ago
  • 7.0.0-alpha.16                                ...           3 years ago
  • 7.0.0-alpha.15                                ...           3 years ago
  • 7.0.0-alpha.14                                ...           3 years ago
  • 7.0.0-alpha.12                                ...           3 years ago
  • 7.0.0-alpha.11                                ...           3 years ago
  • 7.0.0-alpha.10                                ...           3 years ago
  • 7.0.0-alpha.9                                ...           3 years ago
  • 7.0.0-alpha.8                                ...           3 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.22.0                                ...           3 years ago
  • 6.16.0                                ...           4 years ago
  • 6.8.0                                ...           4 years ago
  • 6.7.0                                ...           4 years ago
  • 6.5.2                                ...           4 years ago
  • 6.5.0-1                                ...           4 years ago
  • 6.5.0                                ...           4 years ago
  • 6.4.0                                ...           5 years ago
  • 6.3.13                                ...           5 years ago
  • 6.2.4                                ...           5 years ago
  • 6.1.18                                ...           5 years ago
  • 6.1.17                                ...           5 years ago
  • 6.1.13                                ...           5 years ago
  • 6.1.10                                ...           5 years ago
  • 6.1.5                                ...           5 years ago
  • 6.1.4                                ...           5 years ago
  • 6.0.14                                ...           5 years ago
  • 6.0.2                                ...           5 years ago
Downloads
Today 0
This Week 42
This Month 186
Last Day 42
Last Week 133
Last Month 356
Dev Dependencies (1)

Copyright 2014 - 2016 © taobao.org |