To remove this deprecation warning (DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.) of the example, I replaced new Buffer(…) with Buffer.from(…).
To remove this deprecation warning (
DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
) of the example, I replacednew Buffer(…)
withBuffer.from(…)
.