This module is deprecated because Node 4 is end-of-life, so all currently-supported Node versions support Buffer.from()
. Use that directly instead.
Convert a string to a Buffer across Node versions
See also to-buffer, which is similar but does slightly more, and safe-buffer, which is a complete replacement for Buffer
which polyfills the safe behavior on old Node versions
npm install string-to-buffer
var stringToBuffer = require('string-to-buffer')
stringToBuffer('foobar'); // Buffer
Supports Node 4+, may support earlier versions too.
AJ Jordan alex@strugee.net
MIT