{"name":"buffer-from","version":"1.1.0","license":"MIT","repository":{"type":"git","url":"git+https://github.com/LinusU/buffer-from.git"},"files":["index.js"],"scripts":{"test":"standard && node test"},"devDependencies":{"standard":"^7.1.2"},"keywords":["buffer","buffer from"],"gitHead":"2bea5de4fdca7b13b5a9edafdcb1b74b9ffa6f98","description":"A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available.","bugs":{"url":"https://github.com/LinusU/buffer-from/issues"},"homepage":"https://github.com/LinusU/buffer-from#readme","_id":"buffer-from@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"10.2.1","_npmUser":{"name":"linusu","email":"linus@folkdatorn.se"},"dist":{"integrity":"sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==","shasum":"87fcaa3a298358e0ade6e442cfce840740d1ad04","tarball":"http://registry-npm.ywwl.com/buffer-from/download/buffer-from-1.1.0.tgz","fileCount":3,"unpackedSize":3888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbDeRgCRA9TVsSAnZWagAAd9EP/2tgjGpg0D2foCpZEQKf\nCT1dXMK17+ogbS9ra2xGjuPclU3fkXMihwUINK7/xMoxxFo8fGOwMFPblOHM\nBfO8mEyUyWD8X2SNGwIC3thzobtiQFSiQIzGWag5G6TZxKcnhWXWDcRnGBeu\nfYF5N9K6TDItxL920LlzqJ3Y7glr4Wv7SDJyrzVBfEIGmfgM8aVad5MZNeEK\nv+Nzt/kd2jt5PvUoOoY826q03Vg14awD8vx9tJc6AoaFCOnOBnD/1uAqeg4l\nW404tmnqtfCBdSZj+/iv0xdjJSZqqInsiXK01+HNxorY7mSTc0Bdh0b8tnkA\njONz5g0k5a4S8Y1LYVfNg7MvmryxQFtdBCJj15eYVU5pYkR8AohCOkNF6vCH\nWPjS3FOfY3y6/ffbY32YhLnDAhIMk3leI9UIc2KvbQ0/bJgXHYRhrdU2Iumx\nmrx43cXbwTqLjngV23UISic6/5jJxyUbUYmjTL72j71bU61sZ/AWn8MwAXEY\nN56xPgL8MztdIcwHV+QqjekkP8YLiLutqAui42EtIxd8vZamypd2lOKiKEh6\nyJ641PVOvCKiIEq4F+9jqy0HtNnUIwZ5wOR+CMHwkaM4BkszVbviUA/9B0+K\n8dF13Js/z5YenP+8Atp4CUyAebmCrmJ5prFvFD+blLVoQSMjqz8KvHvHbNrh\nJ6rs\r\n=2hhN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBTe6zGexIXMuWGkMiZbPTA0mzpKkDEsGrBDdX0XhWTnAiAno9YgbbuoBbvIAUztJ9agx+rUsrGgxC9T7seApUP1FA=="}],"size":1627,"noattachment":false,"key":"/buffer-from/-/buffer-from-1.1.0.tgz"},"maintainers":[{"name":"linusu","email":"linus@folkdatorn.se"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/buffer-from_1.1.0_1527637088129_0.03838545968741203"},"_hasShrinkwrap":false,"readme":"# Buffer From\n\nA [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available.\n\n## Installation\n\n```sh\nnpm install --save buffer-from\n```\n\n## Usage\n\n```js\nconst bufferFrom = require('buffer-from')\n\nconsole.log(bufferFrom([1, 2, 3, 4]))\n//=> <Buffer 01 02 03 04>\n\nconst arr = new Uint8Array([1, 2, 3, 4])\nconsole.log(bufferFrom(arr.buffer, 1, 2))\n//=> <Buffer 02 03>\n\nconsole.log(bufferFrom('test', 'utf8'))\n//=> <Buffer 74 65 73 74>\n\nconst buf = bufferFrom('test')\nconsole.log(bufferFrom(buf))\n//=> <Buffer 74 65 73 74>\n```\n\n## API\n\n### bufferFrom(array)\n\n- `array` &lt;Array&gt;\n\nAllocates a new `Buffer` using an `array` of octets.\n\n### bufferFrom(arrayBuffer[, byteOffset[, length]])\n\n- `arrayBuffer` &lt;ArrayBuffer&gt; The `.buffer` property of a TypedArray or ArrayBuffer\n- `byteOffset` &lt;Integer&gt; Where to start copying from `arrayBuffer`. **Default:** `0`\n- `length` &lt;Integer&gt; How many bytes to copy from `arrayBuffer`. **Default:** `arrayBuffer.length - byteOffset`\n\nWhen passed a reference to the `.buffer` property of a TypedArray instance, the\nnewly created `Buffer` will share the same allocated memory as the TypedArray.\n\nThe optional `byteOffset` and `length` arguments specify a memory range within\nthe `arrayBuffer` that will be shared by the `Buffer`.\n\n### bufferFrom(buffer)\n\n- `buffer` &lt;Buffer&gt; An existing `Buffer` to copy data from\n\nCopies the passed `buffer` data onto a new `Buffer` instance.\n\n### bufferFrom(string[, encoding])\n\n- `string` &lt;String&gt; A string to encode.\n- `encoding` &lt;String&gt; The encoding of `string`. **Default:** `'utf8'`\n\nCreates a new `Buffer` containing the given JavaScript string `string`. If\nprovided, the `encoding` parameter identifies the character encoding of\n`string`.\n\n## See also\n\n- [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc`\n- [buffer-alloc-unsafe](https://github.com/LinusU/buffer-alloc-unsafe) A ponyfill for `Buffer.allocUnsafe`\n","publish_time":1527637088325,"_cnpm_publish_time":1527637088325,"dist-tags":{"latest":"1.1.2"}}