Registry / babel-preset-async-to-bluebird

babel-preset-async-to-bluebird

JSON →
library1.1.0jsnpmunverified

A Babel preset that transforms async functions into Bluebird coroutines using .coroutine(). It is a specialized preset for projects already using Bluebird, providing an alternative to the default regenerator-based async-to-generator transform. This package is in maintenance mode with no recent updates; the current version is 1.1.0 and it works with Babel 6.

npm install babel-preset-async-to-bluebird
INSTALL
IMPORT
SIG · BABEL-PRESET-ASYNC
B
babel-preset-async-to-bluebird
javascriptv1.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

async-to-bluebird preset
In .babelrc: "presets": ["async-to-bluebird"]
In .babelrc: "presets": ["babel-preset-async-to-bluebird"]
Babel resolves the full package name automatically; using the full name works but is verbose.
require in Node API
require('babel-core').transform('code', { presets: ['async-to-bluebird'] })
require('babel-preset-async-to-bluebird').transform(...)
The preset is passed as a string, not imported directly.
require in Node API (explicit)
const preset = require('babel-preset-async-to-bluebird'); require('babel-core').transform('code', { presets: [preset] })
If you prefer to require the preset directly, ensure it is passed as an item in the presets array.

Setup Babel with the async-to-bluebird preset and compile an async function using await.

// .babelrc { "presets": ["async-to-bluebird"] } // install // npm install --save-dev babel-preset-async-to-bluebird babel-preset-env // src.js async function fetchData() { const res = await fetch('https://api.example.com/data'); return res.json(); } // Run: npx babel src.js --out-file compiled.js
Debug
Known issues
deprecatedBabel 6 is end-of-life. This preset does not support Babel 7+ (unless using @babel/plugin-transform-async-to-generator with regenerator).
fix
Upgrade to Babel 7 and use @babel/plugin-transform-async-to-generator or keep Babel 6 if legacy.
affects: >=1.0.0
breakingBluebird must be installed separately as a peer dependency (v3+). If Bluebird is missing, async functions will not be transformed correctly.
fix
npm install bluebird
affects: >=1.0.0
gotchaThis preset replaces native async/await with Bluebird coroutines. If you later remove Bluebird, async functions will break.
fix
Only use this preset if you are committed to Bluebird as a dependency.
affects: >=1.0.0
gotchaThe preset does not include any environment-specific transformations (e.g., polyfills for fetch). You need additional presets like babel-preset-env.
fix
Add babel-preset-env to your presets array before async-to-bluebird.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'babel-preset-async-to-bluebird'
Package not installed or not in node_modules.
fix
npm install --save-dev babel-preset-async-to-bluebird
ReferenceError: regeneratorRuntime is not defined
Using async-to-bluebird without having installed or configured Bluebird.
fix
npm install bluebird and ensure it is available at runtime (e.g., require('bluebird')).
TypeError: (0 , _asyncToBluebird) is not a function
Misconfigured Babel preset; likely using an outdated Babel version or incorrect preset reference.
fix
Check Babel version (should be 6) and ensure presets are listed correctly in .babelrc.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
bluebirdrequiredPeer dependency required at runtime for .coroutine()
Agent activity
4 hits · last 30 days
node
4
Resources
babel-preset-async-to-bluebird — npm install babel-preset-async-to-bluebird · libregistry