4 ms·
Regarding point 3, Deno's APIs use language features that were unavailable when node was written, including promises and async iterators. That is a big improvem
by nitsky 6y ago
Regarding point 3, Deno's APIs use language features that were unavailable when node was written, including promises and async iterators. That is a big improvement IMO.
- truth_seeker 6y agoYou can easily PROMISIFY the low level callback style NodeJS SDK APIs using in-built utilities. https://nodejs.org/dist/latest-v8.x/docs/api/util.html#util_util_promisify_original https://nodejs.org/dist/latest-v8.x/docs/api/util.html#util_... It was introduced in NodeJS 8.x release. The latest LTS version is 12.x
- nitsky 6y agoPromisifying makes the node APIs more convenient, but you still do not have the ability to provide back-pressure. See the link below: https://deno.land/v1#promises-all-the-way-down https://deno.land/v1#promises-all-the-way-down
- truth_seeker 6y agoThere are definitely few things which are done in different way in Deno as part of re-design. But that does not mean NodeJS does not take care of it or at least provide the some API to tackle that issue. In this case, Stream interface API in NodeJS are the solution to the problem. They help you build layer over native EventEmitter interface or rather strictly speaking they help extend it. This links might be helpful for you. Backpressuring in Streams - https://nodejs.org/es/docs/guides/backpressuring-in-streams/ https://nodejs.org/es/docs/guides/backpressuring-in-streams/ Official Docs on Stream API - https://github.com/nodejs/node/blob/master/doc/api/stream.md https://github.com/nodejs/node/blob/master/doc/api/stream.md Note that HTTP server in NodeJS already implements it.