How to use the bluebirdCoroutines transformer.
Transforms async functions to their equivalent bluebird method.
require("babel").transform("code", { optional: ["bluebirdCoroutines"] });
$ babel --optional bluebirdCoroutines script.js
In
async function foo() {
await bar();
}
Out
var Bluebird = require("bluebird");
var foo = Bluebird.coroutine(function* () {
yield bar();
});