pnpm
Version:
Fast, disk space efficient package manager
95 lines (94 loc) • 5.5 kB
JSON
{
"_args": [
[
{
"raw": "buffer-from@^1.0.0",
"scope": null,
"escapedName": "buffer-from",
"name": "buffer-from",
"rawSpec": "^1.0.0",
"spec": ">=1.0.0 <2.0.0",
"type": "range"
},
"/home/zoltan/src/pnpm/pnpm/packages/pnpm/node_modules/peek-stream"
]
],
"_from": "buffer-from@>=1.0.0 <2.0.0",
"_id": "buffer-from@1.1.1",
"_inCache": true,
"_location": "/buffer-from",
"_nodeVersion": "10.5.0",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/buffer-from_1.1.1_1533048083841_0.2458068233892754"
},
"_npmUser": {
"name": "linusu",
"email": "linus@folkdatorn.se"
},
"_npmVersion": "6.1.0",
"_phantomChildren": {},
"_requested": {
"raw": "buffer-from@^1.0.0",
"scope": null,
"escapedName": "buffer-from",
"name": "buffer-from",
"rawSpec": "^1.0.0",
"spec": ">=1.0.0 <2.0.0",
"type": "range"
},
"_requiredBy": [
"/csv-parser",
"/peek-stream"
],
"_resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
"_shasum": "32713bc028f75c02fdb710d7c7bcec1f2c6070ef",
"_shrinkwrap": null,
"_spec": "buffer-from@^1.0.0",
"_where": "/home/zoltan/src/pnpm/pnpm/packages/pnpm/node_modules/peek-stream",
"bugs": {
"url": "https://github.com/LinusU/buffer-from/issues"
},
"dependencies": {},
"description": "A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available.",
"devDependencies": {
"standard": "^7.1.2"
},
"directories": {},
"dist": {
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
"shasum": "32713bc028f75c02fdb710d7c7bcec1f2c6070ef",
"tarball": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
"fileCount": 4,
"unpackedSize": 4966,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYHUTCRA9TVsSAnZWagAAgoQP/1LXApc57d1uAc/0mnLq\nCI87dq7EtKS4lG7EjFY3yzxIZxlq1++vH0/sWe0V8je9sHhrm/AkSxlcplEV\nWELPjRwIY4h3LP6U5ppG7XAVGmbipkIAGhiRaJtqGfI/TgPRiB3QcrqanlRG\nBf4oDubBJ2vK8dh5Gd0AhAkkTOsIcf4b5uC64A5GUtMoPOrko+zyRYM8IrRo\n7kDspGfsk3YYxyB/L0APD4AIC8vYz2Gin2ca+zJBZH6cvfThhFWbSnCFfVuW\nxXcheune4boTojusOn5dm4LxzFyMgbeibDZTaq+Yod3RuuUVaSCXWNITcT6g\nIlP7wdbBFGx7Ik5hKEtAGtsCdWshzg9YxHR7g7CPe+0xIeb0zNeKBlxFF2jT\niPeiI+JGlMZuH2Qu+284T9WWom/j0NcbZuWmrV5E1GUimVJqtgqD3S3ivc4y\n6fS6OTIemRUmWwmS7farPxzTs34QkUp0vH/dhuvNeZKockTjLvlveHlOtC4m\nhGp5UdiwrsV7Xqqy/RHlACxPjexkDfhwi0FSeY799VkzbgrPm7Npwn8HwMDI\nv6qpaxPbruRJx65zp1J4DqWlhYENreSFOaXGY/t34GIQ1yNHXGg4Z2ltshPi\nb3lJuLEolQYK5GAcryVnAGusAisYQDfygT1BPxYsVT2ZWYmicpHs7UD+70ya\nfbJa\r\n=YgJu\r\n-----END PGP SIGNATURE-----\r\n"
},
"files": [
"index.js"
],
"gitHead": "53f464194ae30e806f6faef635202b4dfd404ed5",
"homepage": "https://github.com/LinusU/buffer-from#readme",
"keywords": [
"buffer",
"buffer from"
],
"license": "MIT",
"maintainers": [
{
"name": "linusu",
"email": "linus@folkdatorn.se"
}
],
"name": "buffer-from",
"optionalDependencies": {},
"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` <Array>\n\nAllocates a new `Buffer` using an `array` of octets.\n\n### bufferFrom(arrayBuffer[, byteOffset[, length]])\n\n- `arrayBuffer` <ArrayBuffer> The `.buffer` property of a TypedArray or ArrayBuffer\n- `byteOffset` <Integer> Where to start copying from `arrayBuffer`. **Default:** `0`\n- `length` <Integer> 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` <Buffer> 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` <String> A string to encode.\n- `encoding` <String> 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",
"readmeFilename": "readme.md",
"repository": {
"type": "git",
"url": "git+https://github.com/LinusU/buffer-from.git"
},
"scripts": {
"test": "standard && node test"
},
"version": "1.1.1"
}