jerome jerome - 1 month ago 10
Javascript Question

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"

I am currently using these to create synthetic cursor values for GraphQL, for example:

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


Now that the
Buffer
constructor is deprecated, what would be the correct way to do something similar?

Thanks in advance anyone with ideas, I'll dig in on this as well later and post my answer here if I have one.

Answer