mafintosh / duplexify

Turn a writable and readable stream into a streams2 duplex stream with support for async initialization and streams1/streams2 input
MIT License
190 stars 36 forks source link

`Buffer()` without a `new` keyword is going to be hard-deprecated soon #10

Open ChALkeR opened 8 years ago

ChALkeR commented 8 years ago

Refs: https://github.com/nodejs/node/pull/8169, https://github.com/nodejs/node/pull/7152.

Two options here:

More background:

Quick grep (you should better re-check):

duplexify-3.4.5.tgz/test.js:279:      t.same(chunk, Buffer('hello world'))
duplexify-3.4.5.tgz/test.js:290:    dup.write(Buffer('hello world'))

The grep above only includes the lines that call Buffer() without the new keyword, if you choose to move to the new API — you should probably also replace new Buffer(…) calls.

ChALkeR commented 8 years ago

Note: the deprecation was landed and will start printing warnings in Node.js 7.0.

ghost commented 7 years ago

node 7 is bad. This is a bad upstream change.

Trott commented 6 years ago

This can be closed because the deprecation was reverted in a later 7.x release.

jacobq commented 6 years ago

I think this can be closed now since new Buffer only gets called if Buffer.from does not exist.