{"name":"download-tarball","version":"1.0.3","description":"Download a tarball (optionally gzipped) to a folder & extract it in the process. Uses the wonderful & super quick tar-fs & gunzip-maybe libraries.","main":"dist/index.js","scripts":{"test":"xo && babel-tape-runner test.js","build":"rm -rf dist && mkdir -p dist && babel lib --out-dir dist","watch":"rm -rf dist && mkdir -p dist && babel -w lib --out-dir dist","prepublish":"npm run build","posttest":"readme package.json > readme.md"},"repository":{"type":"git","url":"git+https://github.com/kesla/download-tarball.git"},"author":{"name":"David Björklund","email":"david.bjorklund@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kesla/download-tarball/issues"},"homepage":"https://github.com/kesla/download-tarball#readme","devDependencies":{"babel-cli":"^6.10.1","babel-core":"^6.10.4","babel-preset-es2015":"^6.9.0","babel-tape-runner":"^2.0.1","http-test-server":"^1.0.0","package-json-to-readme":"^1.5.1","tapava":"^2.2.0","tar-stream":"^1.5.2","then-fs":"^2.0.0","tmp":"0.0.28","xo":"^0.16.0"},"dependencies":{"got":"^6.3.0","gunzip-maybe":"^1.3.1","http-https-agent":"^1.0.2","object-assign":"^4.1.0","promisify-function":"^1.3.2","pump":"^1.0.1","tar-fs":"^1.13.0"},"xo":{"esnext":true,"space":true},"gitHead":"788fa4ed88d5f9a900cf4ec8ec19cd8ba0c916f0","_id":"download-tarball@1.0.3","_shasum":"7bee6622780481eb72de097092fd19002ef31f32","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"kesla","email":"david.bjorklund@gmail.com"},"dist":{"shasum":"7bee6622780481eb72de097092fd19002ef31f32","tarball":"http://registry-npm.ywwl.com/download-tarball/download/download-tarball-1.0.3.tgz","integrity":"sha512-X2G0+MrvAiZ3i5qzMI6rsXXoa0huDj+NFbf/ixOxQ+jwGR/ecCyJ+88s6VhaVNl7flOQnlRn2yEuZHO7HxobxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCi9WAa9EgoN0ZEGbaQw8kDvITV6RSCJ760P7mDStnOkgIgXf4ykWHXlVHHUYwkm2pmygACVrvq89R52iLMp815Qmg="}],"size":3966,"noattachment":false,"key":"/download-tarball/-/download-tarball-1.0.3.tgz"},"maintainers":[{"name":"kesla","email":"david.bjorklund@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/download-tarball-1.0.3.tgz_1468664600656_0.7612580431159586"},"directories":{},"readme":"# download-tarball \n\nDownload a tarball (optionally gzipped) to a folder &amp; extract it in the process. Uses the wonderful &amp; super quick tar-fs &amp; gunzip-maybe libraries.\n\n## Installation\n\nDownload node at [nodejs.org](http://nodejs.org) and install it, if you haven't already.\n\n```sh\nnpm install download-tarball --save\n```\n\n## Usage\n\n```js\n/* eslint-disable import/no-extraneous-dependencies */\n\nimport download from 'download-tarball';\n\ndownload({\n  url: 'http://link-to-tarball/file.tar.gz',\n  dir: '/dir/where/file/will/be/downloaded'\n}).then(() => {\n  console.log('file is now downloaded!');\n}).catch(err => {\n  console.log('oh crap the file could not be downloaded properly');\n  console.log(err);\n});\n\ndownload({\n  url: 'http://link-to-tarball/file.tar.gz',\n  dir: '/dir/where/file/will/be/downloaded',\n  // custom options that will be forwarded to got.stream(..., opts) can also be set\n  gotOpts: {\n    headers: {\n      beep: 'boop'\n    }\n  }\n}).then(() => {\n  console.log('file is now downloaded!');\n}).catch(err => {\n  console.log('oh crap the file could not be downloaded properly');\n  console.log(err);\n});\n\ndownload({\n  // neat, tar files works as well!\n  url: 'http://link-to-tarball/file.tar',\n  dir: '/dir/where/file/will/be/downloaded'\n}).then(() => {\n  console.log('file is now downloaded!');\n}).catch(err => {\n  console.log('oh crap the file could not be downloaded properly');\n  console.log(err);\n});\n\n```\n\n## Tests\n\n```sh\nnpm install\nnpm test\n```\n\n## Dependencies\n\n- [got](https://github.com/sindresorhus/got): Simplified HTTP requests\n- [gunzip-maybe](https://github.com/mafintosh/gunzip-maybe): Transform stream that gunzips its input if it is gzipped and just echoes it if not\n- [object-assign](https://github.com/sindresorhus/object-assign): ES2015 `Object.assign()` ponyfill\n- [promisify-function](https://github.com/jcollado/promisify-function): Turn a callback-style function into a function that returns a promise\n- [pump](https://github.com/mafintosh/pump): pipe streams together and close all of them if one of them closes\n- [tar-fs](https://github.com/mafintosh/tar-fs): filesystem bindings for tar-stream\n\n## Dev Dependencies\n\n- [babel-cli](https://github.com/babel/babel/tree/master/packages): Babel command line.\n- [babel-core](https://github.com/babel/babel/tree/master/packages): Babel compiler core.\n- [babel-preset-es2015](https://github.com/babel/babel/tree/master/packages): Babel preset for all es2015 plugins.\n- [babel-tape-runner](https://github.com/wavded/babel-tape-runner): Babel + Tape for running your ES Next tests\n- [http-test-server](https://github.com/kesla/test-http-server): Create a simple http server for tests\n- [package-json-to-readme](https://github.com/zeke/package-json-to-readme): Generate a README.md from package.json contents\n- [tapava](https://github.com/kesla/tapava): the syntax of ava, run through tape\n- [tar-stream](https://github.com/mafintosh/tar-stream): tar-stream is a streaming tar parser and generator and nothing else. It is streams2 and operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system.\n- [then-fs](https://github.com/then/fs): promised FS\n- [tmp](https://github.com/raszi/node-tmp): Temporary file and directory creator\n- [xo](https://github.com/sindresorhus/xo): JavaScript happiness style linter ❤️\n\n\n## License\n\nMIT\n\n_Generated by [package-json-to-readme](https://github.com/zeke/package-json-to-readme)_\n","publish_time":1468664605416,"_cnpm_publish_time":1468664605416,"dist-tags":{"latest":"2.0.0"}}