There is a lot to like about Node. I had a look a couple of years ago but lack of a definitive library to handle callback hell put me off. How is the situation these days?
Node v7.5.0 Released
41–50 of 142 posts
Re: Node v7.5.0 Released
#42Re: Node v7.5.0 Released
#43Re: Node v7.5.0 Released
#44Earlier quoted context omitted.
> lack of a definitive library to handle callback hell put me off. 1) Promises. 2) Caolan's async is wonderful for handling all sorts of 'async' problems, like async map and stuff. As close as a de facto library as you can get.
The standard library is still callback hell and the async package doesn't use promises at all.
Re: Node v7.5.0 Released
#45Earlier quoted context omitted.
Also highly recommend the npm async library[1] even though the hipster way is now native async/wait or promises. caolan/async has some amazing sugar on nearly every use-case the most common for me being async.auto(). [1] https://github.com/caolan/async
I highly recommend against using that library - it encourages a lot of callback hell we've found at my company, and it is much harder to create nice reusable functions with it vs. promises. bluebird is a wholly superior library for handling async flow.
Re: Node v7.5.0 Released
#46There is a lot to like about Node. I had a look a couple of years ago but lack of a definitive library to handle callback hell put me off. How is the situation these days?
I wholeheartedly agree. I don't understand why someone hasn't build a compat library that simply promisifies all the standard library (it isn't that big), taking the edge cases into account.
Re: Node v7.5.0 Released
#47Earlier quoted context omitted.
You have a number of ways of keeping a handle on async code now. 1. Native ES6 promises will cover most of your basic needs. See https://developer.mozilla.org/en/docs/Web/JavaScript/Referen... . In fact, unless you have very specific needs not covered by native promises, you shouldn't drop a third party library into your project. 2. For more advanced operations on promises, use Bluebird. See http://bluebirdjs.com and…
My understanding was that Node didn't support native ES6, is that no longer the case? Or are you talking about using a transpiler?
Re: Node v7.5.0 Released
#48Earlier quoted context omitted.
The standard library is still callback hell and the async package doesn't use promises at all.
Promises have been native in node for awhile, so any time you spend in callback hell is entirely your prerogative.
Re: Node v7.5.0 Released
#49Earlier quoted context omitted.
I highly recommend against using that library - it encourages a lot of callback hell we've found at my company, and it is much harder to create nice reusable functions with it vs. promises. bluebird is a wholly superior library for handling async flow.
So much of the promise-based code I see looks almost the same as it would with plain callbacks, just with the callbacks plopped into .then(). Am I missing something? How do promises make for more reusable functions?
Re: Node v7.5.0 Released
#50There is a lot to like about Node. I had a look a couple of years ago but lack of a definitive library to handle callback hell put me off. How is the situation these days?
Many people are complaining that the standard library still uses callbacks and so even though you have async/await, you can't use it with the standard library. I wholeheartedly agree. I don't understand why someone hasn't build a compat library that simply promisifies all the standard library (it isn't that big), taking the edge cases into account.