UNPKG

497 BMarkdownView Raw
1buffer-shims
2===
3
4functions to make sure the new buffer methods work in older browsers.
5
6```js
7var bufferShim = require('buffer-shims');
8bufferShim.from('foo');
9bufferShim.alloc(9, 'cafeface', 'hex');
10bufferShim.allocUnsafe(15);
11bufferShim.allocUnsafeSlow(21);
12```
13
14should just use the original in newer nodes and on older nodes uses fallbacks.
15
16Known Issues
17===
18- this does not patch the buffer object, only the constructor stuff
19- it's actually a polyfill
20
21![](https://i.imgur.com/zxII3jJ.gif)