fstream icon indicating copy to clipboard operation
fstream copied to clipboard

Avoid using deprecated Buffer API

Open ChALkeR opened this issue 7 years ago • 0 comments

Use Buffer.from when it's available instead of new Bufer(string)

Fixes: https://github.com/npm/fstream/issues/60 Refs: https://nodejs.org/api/deprecations.html#deprecations_dep0005_buffer_constructor Tracking: https://github.com/nodejs/node/issues/19079

Given that this is a highly popular module and that Buffer constructor was used in a single place, I decided to add a minimal polyfill in-place (like I do in other similar situations) instead of adding a dependnecy.

/cc @zkat

ChALkeR avatar Mar 22 '18 00:03 ChALkeR