Note: This plugin works with Babel 5. It's not needed in Babel 6. See Babel 5 and Babel 6 below for more info
Use ES7 async functions with babel 5 and creed. This babel plugin turns ES7 async functions into creed coroutines.
Check out an example.
npm install --save-dev babel-creed-async
npm install --save creed
Add babel-creed-async
as a plugin and blacklist regenerator
.
babel --plugins babel-creed-async -b regenerator ...
Add babel-creed-async
as a plugin and blacklist regenerator
in .babelrc or in the babel section of package.json.
{
"plugins": ["babel-creed-async"],
"blacklist": ["regenerator"]
}
You can use the transform-async-to-module-method plugin in Babel 6, instead of babel-creed-async
.
npm install --save creed
{
"plugins": ["transform-async-to-module-method", {
"module": "creed",
"method": "coroutine"
}]
}