Use npm scripts instead of gulp#530
Conversation
| this.dataRes = res; | ||
|
|
||
| var chunks = isBinary ? new Buffer(0) : ''; | ||
| var chunks = isBinary ? new Buffer(0) : ''; // eslint-disable-line node/no-deprecated-api |
There was a problem hiding this comment.
> eslint lib/ test/ *.js
~/engine.io/lib/transports/polling.js
165:27 error 'new Buffer()' was deprecated since v6. Use 'Buffer.alloc()' or 'Buffer.from()' (use 'https://www.npmjs.com/package/safe-buffer' for '<4.5.0') instead node/no-deprecated-api
There was a problem hiding this comment.
@darrachequesne I think the question is, why add the eslint-disable-line instead of going with the advice in the deprecation message and using Buffer.alloc(0)?
There was a problem hiding this comment.
Next question then 😄 : do you suggest adding yet another dependency (safe-buffer), or losing support for Node.js <4.5.0?
There was a problem hiding this comment.
@darrachequesne Any of those would be fine. Is there a reason for keeping support to Node.js versions <4.5.0? Those are obsolete and are not getting security updates. Even 4.x branch would be out of security support in a few months.
Also, you can use Buffer.concat([]) for this specific line (to construct an empty Buffer) to keep support for old Node.js versions and avoid hitting deprecated API. But I would recommend just to drop support for everything older than 4.5.0.
The kind of change this PR does introduce