{"name":"unpack-stream","version":"4.0.2","description":"Unpack a tarball stream","main":"dist/index.js","typings":"dist/index.d.ts","scripts":{"pretest":"rimraf test/dest","test":"npm run tsc && preview && ts-node test --type-check","md":"preview && mos README.md","tsc":"rimraf dist && tsc","prepublishOnly":"npm run tsc"},"repository":{"type":"git","url":"git+https://github.com/zkochan/unpack-stream.git"},"keywords":["tarball","stream","unpack"],"author":{"name":"Zoltan Kochan","email":"z@kochan.io","url":"https://www.kochan.io"},"license":"MIT","bugs":{"url":"https://github.com/zkochan/unpack-stream/issues"},"homepage":"https://github.com/zkochan/unpack-stream#readme","dependencies":{"@types/is-windows":"^0.2.0","@types/node":"^10.0.8","decompress-maybe":"^1.0.0","is-windows":"^1.0.2","ssri":"^6.0.0","tar-fs":"^2.0.0"},"devDependencies":{"@types/tape":"^4.2.30","@types/tempy":"^0.2.0","got":"^8.0.0","ignorable":"^1.0.1","mos":"^2.0.0-alpha.3","mos-plugin-readme":"^1.0.4","package-preview":"^2.0.0","rimraf":"^2.6.1","tape":"^4.7.0","tempy":"^0.2.1","ts-node":"^8.0.2","typescript":"^3.0.0"},"mos":{"plugins":["readme"],"installation":{"useShortAlias":true}},"engines":{"node":">=6"},"gitHead":"84fa48d38457be75c5ed3d759a6ee0b5454ff079","_id":"unpack-stream@4.0.2","_npmVersion":"6.1.0","_nodeVersion":"10.5.0","_npmUser":{"name":"zkochan","email":"z@kochan.io"},"dist":{"integrity":"sha512-9lsxZvzD52IZjUSCd3UKXQi6oErlqK6QCTkQuTE4I1SqO8lh5aoIAxmMgUbixQyWrWW4/DxYuXtbKKmgnXo+MQ==","shasum":"29bdf690222dd10ad9a1d9c3580800bfdbe8f8c6","tarball":"http://registry-npm.ywwl.com/unpack-stream/download/unpack-stream-4.0.2.tgz","fileCount":6,"unpackedSize":13326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfYrbCRA9TVsSAnZWagAA6qUP/jdhE8tXbzwPp8uSfnpb\n2Z47bY93UskgnSOk67No4tmdMIavMQiiQ4VbWv8TLojCm6qkhEv77pWO+CM3\nBTELUhpX94HqTTZkDmV4v0YsgmLoZZ8YI3TDwe0V4F1hnrzeN6dQIfs4j+ij\nyiDsoibj2PcU6KpdvbRh/eeXoLPdrv2mZAlmtJwX/EBx7L+ABNLf9W4smWUG\nJakF8mtpYiBG4U5xi5XtcpDiK5WzJ8SqqSE0lNEluCHpmoaPyqTdBuyGwMjb\nFy4BJnr/SJMozsJ31vMTQdy5nTQbT3AIrIj2n1dbwIB7F6Xe2Es5MTPGA91C\nTdWdV8+6S4YCb5V4RWA7n+GppcHtsRnKubFPtpbFUwIfanDFbY+2/vmL5JI1\nFSWzfQ7iZH19c/Yj7AfjuUxY1zBb6BmE9TF/0Dv+/7PEvF+qkgV/LJg/1dCx\nz8BzAkYlb/ygXsoIKPzJOO+vkqpLMm0e7UJLvyxo0auHsjlvFrqwEw0lyeZ2\nX949f0XQgdxFoleUGcZG+R4HeLLHO13M0RbWLzgJ47kaM0tk8oNRnJcwrSnl\nSGPgbtmxDsPJmQeqVKS6NRf8jKAc2PUNNIf3Xb+uixJiyWAJOqLJPWCXKnCx\nNFq0EDZTvm19FefUSoAp4KJLy4zjPzfuZDG6HJ6aeYW6u7eHXXU+XPzrbjXW\nnV+C\r\n=Hntr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHVcYpd/nRbP94rQN5IV4t5bLm1jIHqRJ4EvROCUNOZOAiBsFUpQFioREnzpZq2rZQ4hbV/meRIwS+sJyI8OECsYkQ=="}],"size":4883,"noattachment":false,"key":"/unpack-stream/-/unpack-stream-4.0.2.tgz"},"maintainers":[{"name":"zkochan","email":"zoltan.kochan@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/unpack-stream_4.0.2_1551731418504_0.2433425778976983"},"_hasShrinkwrap":false,"readme":"# unpack-stream\n\n> Unpack a tarball stream\n\n<!--@shields('npm', 'travis')-->\n[![npm version](https://img.shields.io/npm/v/unpack-stream.svg)](https://www.npmjs.com/package/unpack-stream) [![Build Status](https://img.shields.io/travis/zkochan/unpack-stream/master.svg)](https://travis-ci.org/zkochan/unpack-stream)\n<!--/@-->\n\n## Installation\n\n```sh\nnpm i -S unpack-stream\n```\n\n## Usage\n\n<!--@example('./example.js')-->\n```js\n'use strict'\nconst got = require('got')\nconst unpackStream = require('unpack-stream')\n\nconst tarball = 'https://registry.npmjs.org/is-negative/-/is-negative-2.1.0.tgz'\nconst stream = got.stream(tarball)\nunpackStream.remote(stream, './tmp')\n  .then(index =>\n    Promise.all(\n      Object.keys(index)\n        .map(filename =>\n          index[filename].generatingIntegrity.then(integrity => ({filename, integrity})))\n    )\n  )\n  .then(files => console.log(files))\n  //> [ { filename: 'package.json',\n  //      integrity: 'sha512-RA0APKvtxz85WYCFX3M/TkVeJZZBcylEwh+GrV7uO/NNJO4G3rzgTrpsypp9AU2hM2QBk9SxCHi1Gb9aaWzpYg==' },\n  //    { filename: 'index.js',\n  //      integrity: 'sha512-3dL1OHn8VWhVDT37f3ZBdou4NrYq2ll//W1lWqx7+4tKBW/WqUx3mDcGyqrBfBeWTIPCd+RiUdF7hp3MQYB9+g==' },\n  //    { filename: 'license',\n  //      integrity: 'sha512-lSw93JVg7wfwyVXKrg6yIFjF9Bidgr+tA/l6XNlrRhjnE6NhwkyPL3xNL47OZScS8qoQkYUwE6slmo7jGesH0Q==' },\n  //    { filename: 'readme.md',\n  //      integrity: 'sha512-fM882axp7XaC6nzj5XYuzB0KhYpYwwsR3RjyiqOcIrI6C0b9KxrEEug9VpKTfbSbqTOmZ2KEqZLPKrMXFW1Y+g==' } ]\n```\n<!--/@-->\n\n## API\n\n### `remote(stream, destination, [opts]): Promise<Index>`\n\nUnpacks a remote stream fetched via HTTP.\n\n**Arguments:**\n\n- `stream` - _Stream_\n- `destination` - _string_ - the directory to which the stream will be unpacked\n- `[opts.shasum]` - _string_ - shasum to verify tarball\n- `[opts.onStart]` - _Function_ - called on download start\n- `[opts.onProgress]` - _(downloaded, size) => void_ - tracks the download progress\n- `[opts.generateIntegrity]` - _Boolean_ - `true` by default. If `true`, generates [Subresource Integrity](https://w3c.github.io/webappsec-subresource-integrity/) for each unpacked file\n- `[opts.ignore]` - `(filename: string) => boolean` - a function that decides whether a file should be unpacked from the tarball.\n\n### `local(stream, destination, [opts]): Promise<Index>`\n\nUnpacks a stream from the local filesystem.\n\n**Arguments:**\n\n- `[opts.generateIntegrity]` - _Boolean_ - `true` by default. If `true`, generates [Subresource Integrity](https://w3c.github.io/webappsec-subresource-integrity/) for each unpacked file\n- `[opts.ignore]` - `(filename: string) => boolean` - a function that decides whether a file should be unpacked from the tarball.\n\n## License\n\n[MIT](./LICENSE) © [Zoltan Kochan](https://www.kochan.io)\n","publish_time":1551731418594,"_cnpm_publish_time":1551731418594,"dist-tags":{"beta":"0.1.1","latest":"6.0.0","next":"5.0.1"}}