4 ms·
Disappointing that most promise articles/tutorials reference Q as the preferred promise library, rather than bluebird - https://github.com/petkaantonov/bluebird
by tgriesser 13y ago
Disappointing that most promise articles/tutorials reference Q as the preferred promise library, rather than bluebird - https://github.com/petkaantonov/bluebird https://github.com/petkaantonov/bluebird
Bluebird is not only so fast that it's almost on par with callbacks[1], but also innovates on the ability to filter on catching different error types[2], support for generators[3], context binding[4] among other things.
[1]: https://github.com/petkaantonov/bluebird/blob/master/benchmark/stats/latest.md https://github.com/petkaantonov/bluebird/blob/master/benchma...
[2]: https://github.com/petkaantonov/bluebird/blob/master/API.md#catchfunction-errorclassfunction-predicate-function-handler---promise https://github.com/petkaantonov/bluebird/blob/master/API.md#...
[3]: https://github.com/petkaantonov/bluebird/blob/master/API.md#generators https://github.com/petkaantonov/bluebird/blob/master/API.md#...
[4]: https://github.com/petkaantonov/bluebird/blob/master/API.md#promisebinddynamic-thisarg---promise https://github.com/petkaantonov/bluebird/blob/master/API.md#...
- jbeja 13y agoThat library looks pretty cool and is fairly popular , i will give it a try.
- phpnode 13y agoyes! I recently switched from Q to bluebird and it's been great, and really is exceptionally fast. Also the source code is a work of art - extremely highly optimised.
- inglor 13y agoBluebird is definitely the way to go, we recently introduced it to an existing 100K LoC code base and we couldn't be happier. The stack traces and error management is amazing and everything is very fast.
- angersock 13y agoWe just started using Q for our all--aaaargh, motherfucker. Great to see progress being made, I guess. :(
- tlrobinson 13y agoThe important thing is you're using promises. The differences between Q and Bluebird are minimal, compared to promises vs raw callbacks. I just found this after some cursory Googling and haven't tried it at all, but it appears to be a compatibility layer for Q on top of Bluebird (written by the author of Bluebird): https://gist.github.com/petkaantonov/8363789 https://gist.github.com/petkaantonov/8363789
- angersock 13y agoYeah, for the work we're doing, promises are awesome. I've been doing node work recently and really it's the only thing I've seen that makes sense to me for managing this. It's interesting--I'd considered myself pretty OO in my style, pass a message, hope for the best, but the promises stuff is kind of taking that to its natural conclusion.
- esailija 13y agoI would not say this[1] is a minimal difference :P [1]: https://github.com/petkaantonov/bluebird/blob/master/benchmark/stats/latest.md https://github.com/petkaantonov/bluebird/blob/master/benchma...
- saurik 13y agoI am pretty certain he means in terms of code delta.