Hapi: Drop support for node v8

Created on 19 Jan 2019  路  4Comments  路  Source: hapijs/hapi

Pave the way for new language features such as for await...of.

breaking changes

Most helpful comment

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.

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jney picture jney  路  4Comments

shamsher31 picture shamsher31  路  5Comments

leore picture leore  路  3Comments

RohovDmytro picture RohovDmytro  路  4Comments

arb picture arb  路  4Comments