DoctorMcKay / node-steam-client

API-compatible fork of node-steam's SteamClient
https://steamcommunity.com/groups/SteamRE/discussions/1/
MIT License
52 stars 19 forks source link

Buffer() is deprecated #18

Open Aareksio opened 6 years ago

Aareksio commented 6 years ago

Uses of new Buffer() and Buffer() outside of the node_modules directory will now emit a runtime deprecation warning. [9d4ab90117]

Node 10 displays following warning when ran locally:

[DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. 
Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
DoctorMcKay commented 6 years ago

steam-client still supports Node v4.1.1, while Buffer.alloc was introduced in v4.5.0. Buffer constructors will not be replaced until the next major version (which honestly may not come because steam-user v4 will remove the dependency, whenever I finish that up).

Trott commented 6 years ago

steam-client still supports Node v4.1.1, while Buffer.alloc was introduced in v4.5.0.

If you want to use Buffer.alloc() but also support older versions of Node.js, you can consider using https://www.npmjs.com/package/safer-buffer.