Pave the way for new language features such as for await...of.
Wow! This is a big change.
I would like to have Readable stream async iterator support out of experimental asap. It would be good to have your feedback on that, as it鈥檚 probably a feature that you plan to use.
@mcollina point me in the right direction... happy to play with it.
With current v10, BigInt support is also included, and URL is exposed as a global (no need to require('url')).
It also allows us to use util.types for type detection in Hoek.
@hueniverse https://github.com/nodejs/readable-stream/issues/333. I also wrote https://github.com/mcollina/stream-iterators-utils#utilstoreadablegenerator-opts ( I'd like to get it into core at some point).
Overall the question is that:
const http = require('http')
async function handle (req, res) {
let chunks = []
for await (let chunk of req) {
chunks.push(chunk)
}
res.end()
}
http.createServer(function (req, res) {
handle(req, res).catch(() => res.end())
})
Is stable for the Hapi community to use. It also works on files and on any other stream from core or created via readable-stream.
Most helpful comment
With current v10,
BigIntsupport is also included, andURLis exposed as a global (no need torequire('url')).It also allows us to use
util.typesfor type detection in Hoek.