bluebirdCoroutines

How to use the bluebirdCoroutines transformer.

Transforms async functions to their equivalent bluebird method.

Usage

require("babel").transform("code", { optional: ["bluebirdCoroutines"] });
$ babel --optional bluebirdCoroutines script.js

Example

In

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

Out

var Bluebird = require("bluebird");

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