Deprecation warning
(node:1) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
FYI, this can be worked around by creating the Buffer before hand instead of passing in the raw string
lz.compress(Buffer.from(str))
Thanks for the reports. I apologize for not being very responsive. The library has been semi-maintained for a while. I will see what is needed to fix the issue.
I've made this commit that changes two calls to Buffer() to Buffer.from():
The two calls are in:
- Base64.ts
- UTF8.ts
There's a third call in:
- BufferTools.ts
That I did not modify, as it's in a conditional branch that shouldn't be executed on modern versions of Node.
Testing on latest node seem to pass. However this breaks on versions before 10, which I guess is okay.
I've publishd on npm (version 0.5.8).