{"name":"unpack-stream","version":"3.0.2","description":"Unpack a tarball stream","main":"dist/index.js","typings":"dist/index.d.ts","files":["dist/"],"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/node":"^9.3.0","decompress-maybe":"^1.0.0","ssri":"^5.0.0","tar-fs":"^1.14.0"},"devDependencies":{"@types/tape":"^4.2.30","got":"^8.0.0","ignorable":"^1.0.1","mos":"^2.0.0-alpha.3","mos-plugin-readme":"^1.0.4","package-preview":"^1.0.0","rimraf":"^2.6.1","tape":"^4.7.0","ts-node":"^5.0.0","typescript":"^2.4.2"},"mos":{"plugins":["readme"],"installation":{"useShortAlias":true}},"engines":{"node":">=4"},"gitHead":"7860bff30013599c8c7a9d5001c6c5ca963fa6b6","_id":"unpack-stream@3.0.2","_npmVersion":"5.7.1","_nodeVersion":"6.11.4","_npmUser":{"name":"zkochan","email":"z@kochan.io"},"dist":{"integrity":"sha512-mdQv3N9fkxG04/4G8HLg3Q/whJscMTUikRQU2pTr4ISU9t59xoRGUEeqpUwpj78jZUPB7LN6oabkyZJ574MleA==","shasum":"a2d1f2e0b1776ac1bf41f60ad91df90e10e43cd0","tarball":"http://registry-npm.ywwl.com/unpack-stream/download/unpack-stream-3.0.2.tgz","fileCount":6,"unpackedSize":11689,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFVe5hrJcplVLcMMG1Ui6OKVTDcYmdIXPTXmxVfbOcuDAiEA62jMrbCF8ku4Wsg8tYoz2gHXsEubY5KAt5n0/vEKexc="}],"size":4545,"noattachment":false,"key":"/unpack-stream/-/unpack-stream-3.0.2.tgz"},"maintainers":[{"name":"zkochan","email":"zoltan.kochan@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/unpack-stream_3.0.2_1521488979595_0.721620093104044"},"_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":1521488979651,"_cnpm_publish_time":1521488979651,"dist-tags":{"beta":"0.1.1","latest":"6.0.0","next":"5.0.1"}}