{"mos":{"plugins":["readme"],"installation":{"useShortAlias":true}},"bugs":{"url":"https://github.com/zkochan/unpack-stream/issues"},"dist":{"shasum":"280f2bc330517f77ac3a5007351f1745c4c291dc","tarball":"https://registry.npmjs.org/unpack-stream/-/unpack-stream-5.0.1.tgz","fileCount":6,"integrity":"sha512-MR9t86P3I8THidcbdwjH6Az4908rH/mDuwhDPMNYHdIfM0MPjYH4rJfUu9RlpraFHeMYW76bWyte7ug+80IrPw==","signatures":[{"sig":"MEUCIQDCz4FrhaFKgGGtWe8wHFW+dnCMv0yGAG03PRshsuSP3wIgKX3dKh+lHP4NNqb2HuaEK4F9jJOXiUEbaFRmbp0jbJk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11497,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcoMr1CRA9TVsSAnZWagAAqFwP/3Ku9kYjjVlfpiqtd1Cz\nlflpQw5S2s6i7ihIynLwjD32pq5yHovM2E+q9m6xQ8BAh0/MpklznhkXctuw\nDcIBiWODfaFBEAaDS2PpvxW0qW5Xrqgwuan90OsUWd0rk01KmyExOlPzNsYA\nfrGVHRyRMeP7FD0dEX5yhMuYsnFV9oP4VveS8Ix0n0iLGFK09q9Np2EJC+MO\nCMFhbvTp8kWFKp5S8kPiXJegs3BZwPnb6jcPnZ5W0kQmlPCGeRKTxrf8iEcv\nUfRn86bp36jkWwxnXuMm/evEXdUIn5O62Zgj4MAwSUk5RtLDQzWiQ96HSd+t\nFzQKeeL7VYxc+01V6j5RDaiW4fwzyh/2qbUcCn8zW/9Wvp/WnOeU7ifb0wM6\nYMoLotEYM8JEsb/pQz0LFT7JkKrQf77OKu8/PujT/6/+OOMoKkkVndE0SM2Z\n7M76/8U5wAepO3trRU2O+2MJURiLpv+ExB6EihMQhqHt2HC531eW0DqZ3lCJ\n99v4+bk9nJqFbI9ULuHk0PxhkN9Wq3i/IlBQ/utzBNy0BSMJWYv1FRd8fyn1\nrAEqsvxEG7bbzUBT8DmGurkix80D9/JYhBJ7qbtEScyOZIFyNx2kosA50loe\nQuIHe2aGVTCeQcX4bqaMPVraVl4of5kfxhkItwsibtQnHop+qSGumLzGV99a\ndHqc\r\n=xE8k\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","name":"unpack-stream","author":{"url":"https://www.kochan.io","name":"Zoltan Kochan","email":"z@kochan.io"},"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","engines":{"node":">=8"},"gitHead":"549f8f5e5f1f6d8b3962ef3c454c9d6130e33dda","license":"MIT","scripts":{"md":"preview && mos README.md","tsc":"rimraf dist && tsc","test":"npm run tsc && preview && ts-node test --type-check","pretest":"rimraf test/dest","prepublishOnly":"npm run tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"zkochan","email":"z@kochan.io"},"homepage":"https://github.com/zkochan/unpack-stream#readme","keywords":["tarball","stream","unpack"],"repository":{"url":"git+https://github.com/zkochan/unpack-stream.git","type":"git"},"_npmVersion":"6.9.0","description":"Unpack a tarball stream","directories":{},"maintainers":[{"name":"zkochan","email":"zoltan.kochan@gmail.com"}],"_nodeVersion":"10.12.0","dependencies":{"ssri":"^6.0.0","tar-fs":"^2.0.0","@types/node":"*","decompress-maybe":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"got":"^9.6.0","mos":"^2.0.0-alpha.3","tape":"^4.7.0","rimraf":"^2.6.1","ts-node":"^8.0.2","ignorable":"^1.0.1","typescript":"^3.0.0","@types/tape":"^4.2.30","package-preview":"^2.0.0","mos-plugin-readme":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/unpack-stream_5.0.1_1554041588518_0.8289723334612928","host":"s3://npm-registry-packages"},"_id":"unpack-stream@5.0.1","version":"5.0.1"}