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, 10:50:02 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

33 sources
It's honestly not as much of an issue as it's often made out to be. There are a ton of ways to manage asynchronous code out there including but not limited to all the various promise libraries such as when.js(https://github.com/cujojs/when), q (https://github.com/kriskowal/q), and bluebird (https://github.com/petkaantonov/bluebird). Not to mention the Async library (https://github.com/caolan/async) which is full of tools to help manage it. As for blocking, it's something you deal with. Realistically speaking if you're doing CPU intensive tasks then Node is definitely the wrong solution. However, if you're doing tasks that are IO oriented then Node is fantastic.
In Yahoo Mail moving to React
This is a really nice alternative to Promises, which I have grown to really love in the last few months - especially since bluebird (https://github.com/petkaantonov/bluebird) handles errors really sanely. It takes a lot of getting used to but it is really, really nice to be able to surround error-prone code in what amounts to a try/catch, with a single catch that can (like Java) branch based on error type. For a second it feels like sync programming. As cool as ICS is, I strongly prefer the yield syntax to the await/defer syntax. It's a single keyword and it's much more obvious where the value is coming from. Plus, it's going to be everywhere soon. At keybase, do you guys intend to continue with ICS or eventually move to ES6?
In Handling Errors in IcedCoffeeScript
I'm not convinced that this guide is very good. On many of the issues the actual decision is punted in favor of "just make sure it's consistent". Well obviously, that's why there's a guide. The purpose is to lay down the law so everyone knows HOW to be consistent. Moreover, a few of the suggestions introduce serious performance issues, notably around iteration and the treatment of the `arguments` object. If you haven't yet, please do check out Petka Antonov's Optimization Killers [0]. [0]: https://github.com/petkaantonov/bluebird/wiki/Optimization-k...
In A JavaScript Quality Guide
Sorry, should have clarified on 2. As an expansion of one of the examples given: loadAndPrintFile: (contents) { if (!contents) { fs.readFile() -> (error!, contents) } console.log(contents); } i.e., expected behavior would be as if readFile was not an async function. I'm asking because I built something similar (though it only worked with promises, not general async functions), and I'm curious to compare approaches :-) - mine is a sweet.js macro: http://pastie.org/9410315 (uses https://github.com/petkaantonov/bluebird and https://github.com/BranchMetrics/promise-accum). The basic syntax would be: task { item1 <- LoadItem(1); item2 <- LoadItem(item1.foreign_key); ret <- DoSomethingWithItems(item1, item2); }
In Show HN: I built an extension of JavaScript in a day
Your assumptions are outdated and this is FUD. Promises that implement Promises A+ are consistent. The fact that jQuery's implementation is broken has no relation to promises whatsoever (nobody seriously calls them promises anymore). But I was talking about a different kind of consistency: consistency in your code. Errors not being swallowed, the same representation for all async values. The performance post you linked to is almost a year old and is quite outdated. Since it was posted, Bluebird[1] was written and leveled up the game: file time(ms) memory(MB) promises-bluebird-generator.js 171 16.52 callbacks-baseline.js 197 20.68 promises-bluebird.js 280 26.64 promises-lvivski-davy.js 616 58.75
Read the rest
promises-dfilatov-vow.js 672 80.59 promises-cujojs-when.js 731 68.74 callbacks-caolan-async-waterfall.js 733 44.57 [1]: https://github.com/petkaantonov/bluebird/blob/master/benchma...
In Contra – Asynchronous flow control with a functional taste to it
On the topic of using callbacks, promises + generators will enable you to do the same job with almost the same level of performance (see http://spion.github.io/posts/why-i-am-switching-to-promises....) whilst avoiding callback hell and having to perform error handling in multiple places. A good Promise library (like https://github.com/petkaantonov/bluebird) even provides mechanisms for writing functions that both return Promises as well as accept callbacks, allowing your API client to choose how they wish to use it. Also, beware of making a function "asynchronous" by simply having it accept a callback parameter, e.g.: function myFunc(v, cb) { someOtherObject.v = v; cb(); } myFunc(5, function(err) { if (err) return console.error(err); console.log('call done'); }); console.log('call started'); In the above code,
Read the rest
you'll see "call done" before you see "call started" because myFunc() isn't really functioning asynchronously. This is yet another reason to use a good Promise library like Bluebird, as it ensures that even if you wrap a synchronous function inside a Promise the resulting execution will flow as if it was asynchronous.
In JavaScript (and Node) Best Practices
regarding your edit, you're exactly right, of course a for loop will be faster. Sometimes you really do need a function call though, in which case fast forEach and map implementations become more useful. The next step for fast.js are some sweet.js macros which will make writing for loops a bit nicer, because it's pretty painful to write this every time you want to iterate over an object: var keys = Object.keys(obj), length = keys.length, key, i; for (i = 0; i < length; i++) { key = keys[i]; // ... } I'd rather write: every key of obj { // ... } and have that expanded at compile time. Additionally there are some cases where you must use inline for loops (such as when slicing arguments objects, see https://github.com/petkaantonov/bluebird/wiki/Optimization-k...) and a function call is not
Read the rest
possible. These can also be addressed with sweet.js macros.
In Show HN: Fast.js – faster reimplementations of native JavaScript functions

Showing the 15 most recent of 33 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.