$ npm install bfs-buffer
An emulation of NodeJS's Buffer module. Used in BrowserFS.
ArrayBuffer in modern browsersCanvasPixelArray in older browsers that do not support typed arrays, but support the canvas.Array of 32-bit ints in older browsers without the above.Buffer API! (including string encoding)
Buffer tests.
This module can be used with Browserify in place of its default Buffer module!
Here's the relevant configuration:
{
builtins:
{
"buffer": require.resolve('bfs-buffer')
},
insertGlobalVars: {
"Buffer": function() { return "require('bfs-buffer').Buffer" }
}
}
buff[0] = 3.
Buffer to Uint8Array, as in the official Node implementation of Buffer, is not portable across browsers.© 2010 - cnpmjs.org x YWFE | Home | YWFE