DEV Community

Discussion on: On Deno and the future of Node

Collapse
 
medikoo profile image
Mariusz Nowak

Removing promises from Node back in 2010

Node.js never had promises, not until native came in with V8.

What was called promises in few old versions (last one was v0.1.29) was purely a simple extension to event emitter, nothing more (no then, no nested resolution, it had nothing to do with promises which we work with now)

You may confirm that at still available documentation: nodejs.org/docs/v0.1.29/api.html#_...

Still, it's true, core Node.js members didn't believe in promise interface even when Promise A+ started to be really popular. It's only after it became a part of a standard, things changed. async/await was delivered in Node.js on par with browsers, soon after we also got fs.promises.

Anyway to this day (as lighter, and not introducing artificial ticks) callbacks are faster than promises, but for most of real world scenarios difference can be safely ignored.

Collapse
 
bogdanned profile image
Bogdan Nedelcu

Thanks for the suggestion. And thanks a lot for the reference to the v0.1 docs. I will take a closer look and update where appropriate. Much appreciated!