节点 6 缓冲区构造函数已弃用,应该使用什么?

Node 6 Buffer constructor deprecated, what to use instead?

https://nodejs.org/en/blog/release/v6.0.0/

"Existing Buffer() and SlowBuffer() constructors have been deprecated"

我目前正在使用这些为 GraphQL 创建合成游标值,例如:

new Buffer(<cursor>).toString('base64')

现在 Buffer 构造函数已弃用,执行类似操作的正确方法是什么?

提前感谢任何有想法的人,我稍后也会对此进行深入研究,post如果有的话,我会在这里回答。

正在关注 node documentation

Class Method: Buffer.from(array)