HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
petkaantonov
bluebird
JavaScript2013–2022
petkaantonov / bluebird

bluebird

:bird: :zap: Bluebird is a full featured promise library with unmatched performance.

66Distinct people
87Mentions
2Explicit recommenders
20.5KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

:bird: :zap: Bluebird is a full featured promise library with unmatched performance.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

The examples are very far from the JS I see and read, but this is definitely a very useful tool. It seems like gcc -Olevel. It would be interesting to incorporate some sort of…

jamescostian used a recommendation phrase. 2 indexed comments match. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

  • kriskowal/q · linked in 3 of the same discussions
  • tj/co · linked in 3 of the same discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 11:39:46 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year87 dated mentions

Observed mentions: 2013-10-04 10:29:42 UTC to 2022-08-24 21:34:55 UTC.

01020302013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 8 mentions; 2 submissions, 6 comments20132014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 33 mentions; 5 submissions, 28 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 23 mentions; 3 submissions, 20 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 17 mentions; 3 submissions, 14 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC826
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC33528
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC23320
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC17314
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC303
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Got a question? Join us on stackoverflow, the mailing list or chat on IRC Introduction Bluebird is a fully featured promise library with focus on innovative features and performance See the bluebird website for further documentation, references and instructions. See the API reference here. For bluebird 2.x documentation and files, see the 2.x tree. ⚠️Note⚠️ Please use native promises instead if at all possible. Native Promises have been stable in Node.js and browsers for around 10 years now and they have been fast for around 7. Any utility bluebird has like .map has native equivalents (like Node streams' .map). This is a good thing, the people working on Bluebird and promises have been able to help incorporate most of the useful things from Bluebird into JavaScript itself and platforms/engines. If there is a feature that keeps you using bluebird. Please let us know so we can try and upstream it :) Currently - it is only recommended to use Bluebird if you need to support really old browsers or EoL Node.js or as an intermediate step to use warnings/monitoring to find bugs. Questions and issues The github issue tracker is only for bug reports and feature requests. Anything else, such as questions for help in using the library, should be posted in StackOverflow under tags promise and bluebird. Thanks Thanks to BrowserStack for providing us with a free account which lets us support old browsers like IE8. License The MIT License (MIT) Copyright (c) 2013-2021 Petka Antonov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Read the full README on GitHub

What Hacker News says

23 sources
> Promises are not the only way to do async work in JS, as much as some people like to say that. You have observables and channels, which are more powerful because they handle streaming. Let me just try and translate that into sync-land: "Single value variables are not the only way to do work in JS, as much as some people like to say that. You have arrays and queues, which are more powerful because they handle multiple values" (my point being, different abstractions are useful for different things and/or in different ways) > There are proposals to make async/await more composable: https://github.com/jhusain/compositional-functions. TC39 is aware of this but I'm not sure if they are going to fix it or not. I agree, but I don't think we need async/await at all. http://spion.github.io/posts/es7-async-await-step-in-the-wro... > You shouldn't
Read the rest
be forced to run code inside a try/catch. How is throwing on typos useful? The real solution for that isn't letting errors get through. Its having a type system like TypeScript or Flow plus using a sensible library like bluebird that reports rather than swallows up unhandled errors by default. Afaik errors from native promises are reported to the console in most browsers. And there are also tools like this: https://github.com/emberjs/ember-inspector/wiki/Promises-Tab Allowing thrown errors to propagate synchronously will destroy many contractual guarantees that make promises useful in nodejs. For example, we would have to remove this entire section in Bluebird: https://github.com/petkaantonov/bluebird/blob/master/API.md#... and instead fall back to process crashing and restarting. Lack of error catching is what makes node unable to provide a safe solution to the crashing problem (and domains capture errors in both directions of the call stack which leads to problems inside node internals). Promises neatly solve that by providing a sensible error capturing and propagation model that isolates node internals from promise code: https://github.com/petkaantonov/bluebird/issues/51
In Microsoft Edge gets native ECMAScript 7 async/await support in latest build
> I used a similar code flow as the standard callback example previously described, except that I included the chaining of error handling with parallels to synchronous try/catch/finally flows. You do the promise-as-a-pyramid example, then say you still have to nest and leave it at that, misrepresentation if not malice. Basically, you have a solution through promises you're not showing either because you were unaware or because you chose to, I _hope_ it's the former. > not an example of how to use promises in production code. I have some 3 year old production code that begs to differ :) > Additionally, this is an article about framework design, not how to use them, making your corrections (which involve using a framework with chainable proxy queues) somewhat tangental to the discussion. Promises are not a framework, and your proxy queues
Read the rest
don't make sense for someone who understand promises. If you go look at Mark Miller's original work on promises you'll see that promises are proxies for asynchronous actions - that's why they were created in the first place. It's also a great read regardless. > You seem to have the generic concept of a promise confused with a particular promises implementation with some extensions that you particularly like. I only used that because that's the library you used in the question. With bluebird it would have been significantly nicer. > The Promises/A[0] specification Promises/A is an old specification about _interoperability_ that no one (its authors included) care about anymore. > Even the Promises/A+[1] spec Promises/A+ is a spec about interoperability between promise libraries. It only specifies `then` and even there only what it must. > This isn't a criticism of the model, it's an explanation of the model and some suggested extensions. Then I'm sorry but it's not a particular good one, really, I don't know who you are and I mean no offence but I think your article does a disservice to promises. > I'm really curious as to how you managed to miss that point. Your technique added an _extra layer_ on top of an _existing layer_ that already _solves the problem you're solving_. Promises were designed to be callback queues from the 80s by Barbara Liskov and Mark Miller. Reinventing the core concepts is insanely cool but it does a big disservice to the existing tooling. > I think we can both agree that, to a developer not possessing your level of skill, the revised example is slightly easier to follow. I think it conflates promises with values, we've offered this technique in Bluebird for years now as an example in https://github.com/petkaantonov/bluebird/blob/master/API.md (see under "Using defaultPromisifier parameter to add enhancements on top of normal node promisification:) without anything more than `.all`ing the arguments. > Thank you very much for the encouraging words, but in the future, could you do everyone a favor and either read an author's biography or click on the author link before making wild assumptions about his or her programming background? I apologize for this, totally my bad. Is there anything you made that I'd recognise from JS land? > The context might make it easier for you to understand the article itself, making your comments far more valuable. I don't want to turn this into a pissing contest but I'm pretty sure I understand promises, proxies and all that. I apologize for the tone in the original comment (I'll edit it if you'd like) it was uncalled for but I really think there is a lot to improve in the article.
In Pseudosynchronous JavaScript
OK, I'll shoot: Why not Promises? They don't handle streaming data, but they're not supposed to; they're supposed to model the traditional JS function call model (single value return or single value exception) which they do well. For streaming data use some other paradigm (perhaps Observables from https://github.com/jhusain/asyncgenerator), but that's orthogonal to Promises, not a replacement for them. The only other reasonable complaint I've heard is that they aren't cancellable, which is legit. There are proposals for that, though (https://github.com/petkaantonov/bluebird/blob/master/API.md#...). At least with Promises functions actually return, as opposed to the continuation-passing-style of callbacks. (CPS is a fine intermediate representation for compilers, but it really shouldn't be written by hand; that's why we have compilers!
Read the rest
)
In Node.js: Cluster vs. Async
"Asynchronous event-driven programming is at the heart of Node.js, however it is also the root cause of Callback Hell." I'd argue the root cause is... callbacks. Asynchronous programming can be done elegantly, in a synchronous style using "async/await", originally (?) in C# [1], likely to be added to the next version of JavaScript [2], also in Dart [2], Hack [4], and Python 3.5 [5]. It can also be emulated in languages with coroutines/generators [6][7][8] (which in turn can be implemented by a fairly simple transpiler [9][10]) This: function foo(a, callback) { bar(a, function(err, b) { if (err) { callback(err) } else { baz(b, function(err, c) { if (err) { callback(err) } else { // some more stuff callback(null, d)
Read the rest
In Node.js: Cluster vs. Async
Great article; a few things I would add. I use bluebird for Promises, which is just the most fantastic Promises lib ever conceived, no joke; if you haven't used it try it. So some of these may be Bluebird-specific: 1. Don't wrap callback functions manually with `new Promise(function(resolve, reject) {...})`, just use `Promise.promisify(...)`. For one-off functions, try `Promise.fromNode(function(cb) { fs.readFile('..', cb); });`. 2. This pattern: getUserByName('nolan').then(function (user) { return getUserAccountById(user.id); }).then(function (userAccount) { // I got a user account! }); Could be: getUserByName('nolan') .get('id') .then(getUserAccountById) .then(function (userAccount) { // I got a user account! }); 3. I too used Promise.resolve().then(...) to start a lot of route handlers. Try `Promise.try(
Read the rest
function() {...})`, which is equivalent but reduces the temptation to just stick a synchronous value in the `Promise.resolve()` just because you can. 4. `Promise#nodeify()` is super useful for creating functions that return promises or use callbacks depending on how they're called. For example: function getUserName(id, cb) { return db.getUserAsync(id).get('name') .nodeify(cb); } Is the same as: function getUserName(id, cb) { var promise = db.getUserAsync(id).get('name'); if (!cb) return promise; promise.then(function(result) { cb(null, result);}) .catch(function(e) { cb(e); }); } This is great if you want to convert a few functions you use to promises, but they're called elsewhere and expect a callback style. I'm sure there are many more. This is my bible: https://github.com/petkaantonov/bluebird/blob/master/API.md In short; use Promises! They are the answer for callback hell in Node. Async/await may fix more problems in the future but if you want Node/Browser compatibility and to get started right now, Promises are the best way to go.
In We have a problem with promises

Showing the 15 most recent of 23 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.