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, 8:59: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

8 sources
Have you looked into bluebird[1]? It and most of the available promise libraries have a nodify-esque function where you can simple do this: var fs = Promise.promisifyAll(require("fs")); And all of the regular methods in fs are now promisable. Q also seems to be one of the slowest[2] promise libraries there is. I'm not sure why so many people use it. That guy has a rather large benchmark table from a couple months ago as well and Q seems to be shockingly slow compared to the dozen or so other promise libraries out there. 1. https://github.com/petkaantonov/bluebird 2. http://spion.github.io/posts/why-i-am-switching-to-promises....
In JavaScript Promises: There and back again
I'm sorry, but: 1. Its a promise library. It gives you a Promise class, a PromiseResolver and some tools to convert node functions to promises or to support dual promise/callback API. 2. Its super-fast and has full stack traces that go back until the beginning of the async event chain 3. I will skip this, because, uhh... 4. You didn't look hard enough. https://github.com/petkaantonov/bluebird/tree/master/src 5. Yes, promises are confusing. I'm going to write a straight-forward introduction (that uses bluebird) this weekend. But once you get past the new words and definitions, promises are actually not complicated at all. Infact, here is a short intro: How are promises different? Instead of writing your functions to take callbacks, you write functions that return promises. Imagine that node's fs.readFile returned a promise instead of takin
Read the rest
g a callback. Then this code: fs.readFile(file, function(err, res) { if (err) handleError(); doStuffWith(res); }); would look like this: fs.readFile(file).then(function(res) { doStuffWith(res); }, function(err) { handleError(); }); Pretty much the same so far, except you use a second callback for the error (which isn't really better). So when does it get better? Its better that you can attach a callback later if you want. Remember, `fs.readFile(file)` returns a promise now, so you can put that in a var: var filePromise = fs.readFile(file); // do more stuff... filePromise.then(function(res) { ... }); Okay, that's still not much of an improvement. How about this then? You can attach more than one callback to a promise if you like: filePromise.then(function(res) { uploadData(url, res); }); filePromise.then(function(res) { saveLocal(url, res); }); Still not good enough? What if I told you... that if you return something from inside the .then() callback, then you'll get a promise for that thing? Say you want to get a line from a file: var linePromise = fs.readFile(file).then(function(data) { return data.toString.split('\n')[line]; }); var beginsWithHelloPromise = linePromise.then(function(line) { return /^hello/.test(line); }); Thats pretty cool. But the coolest thing is probably this: if you return a promise from within `.then`, you will get that promise outside of `.then`: function readUploadAndSave(file, url, otherPath) { // read the file var filePromise = fs.readFile(file); // upload it when done reading var uploaded = filePromise.then(function(content) { return uploadData(url, content); }); // also save to another place locally var savedLocal = filePromise.then(function(res) { return fs.saveFile(res, otherPath) }); // return a promise that "succeeds" when both saving and uploading succeed: return Bluebird.join(uploaded, savedLocal); } readUploadAndSave(file, url, otherPath).then(function() { console.log("Success!"); }, function(err) { // This function will catch *ALL* errors, from the above // operations including any exceptions thrown inside .then console.log("Oops, it failed.", err); }); Now its easier to understand the chaining. At the end of every function passed to a `.then()`, return a promise. Lets make our code even shorter: function readUploadAndSave(file, url, otherPath) { // read the file return fs.readFile(file).then( // upload and save when done reading return Bluebird.join(uploadData(url, content), fs.saveFile(res, otherPath)); }); } What if we want to make sure the data is uploaded first before saving? function readUploadAndSave(file, url, otherPath) { // read the file var uploadedPromise = fs.readFile(file).then( // return promise that its uploaded return uploadData(url, content); }); return uploadedPromise.then(function() { // return promise that its saved. return fs.saveFile(res, otherPath); }); } Or even shorter, skip the temporary promise variables and chain .then the way we chain `stream.pipe` in node: function readUploadAndSave(file, url, otherPath) { // read the file return fs.readFile(file).then( // then upload it return uploadData(url, content); }).then(function() { // after its uploaded // save it return fs.saveFile(res, otherPath); }); } And similarly to how in a stream.pipe chain the last stream is returned, in promise pipes the last returned promise is returned. Thats all you need, really. The rest is just converting callback-taking functions to promise-returning functions and using the stuff above to do your control flow. Ah, and also, you can also return values in case of an error. So for example, to write readFileOrDefault (which returns a default value if for example the file doesn't exist) you would do this: function readFileOrDefault(file, line, defaultContent) { return fs.readFile(file).then(function(fileContent) { return fileContent; }, function(err) { return defaultContent; }); }
In Bluebird – A full-featured, fast promises library for JavaScript
Looks awesome, I've been using JS Promises recently and it's made control flow a lot easier to handle. I've been using Vow, because I like having an .always() that gets called after the promise was handled (rejected or fulfilled), but sadly that library eats tracebacks (at least, I can't figure out a way to do it). Bluebird looks promising, but IE<9 isn't supported at the moment (https://github.com/petkaantonov/bluebird/issues/3). Rules it out for most of my projects.
In Bluebird – A full-featured, fast promises library for JavaScript

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.