# download-tarball

> Download a tarball (optionally gzipped) to a folder & extract it in the process. Uses the wonderful & super quick tar-fs & gunzip-maybe libraries.

Latest version **2.0.0** (published 2018-10-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install download-tarball
pnpm add download-tarball
yarn add download-tarball
bun add download-tarball
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-10-24 |
| First published | 2016-07-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 9.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 8 |
| Author | David Björklund |
| Maintainers | kesla |

## Links

- npm: https://www.npmjs.com/package/download-tarball
- Repository: https://github.com/kesla/download-tarball
- Homepage: https://github.com/kesla/download-tarball#readme
- Issues: https://github.com/kesla/download-tarball/issues
- npm.io page: https://npm.io/package/download-tarball

## Dependencies (6)

- [got](https://npm.io/package/got.md) ^8.3.2
- [pump](https://npm.io/package/pump.md) ^1.0.1
- [tar-fs](https://npm.io/package/tar-fs.md) ^1.13.0
- [gunzip-maybe](https://npm.io/package/gunzip-maybe.md) ^1.3.1
- [object-assign](https://npm.io/package/object-assign.md) ^4.1.0
- [promisify-function](https://npm.io/package/promisify-function.md) ^1.3.2

## Recent versions

- 2.0.0 (latest) — 2018-10-24
- 1.1.0 — 2017-09-07
- 1.0.3 — 2016-07-16
- 1.0.2 — 2016-07-14
- 1.0.1 — 2016-07-13
- 1.0.0 — 2016-07-13

## README

# download-tarball 

Download 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.

## Installation

Download node at [nodejs.org](http://nodejs.org) and install it, if you haven't already.

```sh
npm install download-tarball --save
```

## Usage

```js
/* eslint-disable import/no-extraneous-dependencies */

import download from 'download-tarball';

download({
  url: 'http://link-to-tarball/file.tar.gz',
  dir: '/dir/where/file/will/be/downloaded'
}).then(() => {
  console.log('file is now downloaded!');
}).catch(err => {
  console.log('oh crap the file could not be downloaded properly');
  console.log(err);
});

download({
  url: 'http://link-to-tarball/file.tar.gz',
  dir: '/dir/where/file/will/be/downloaded',
  // custom options that will be forwarded to got.stream(..., opts) can also be set
  gotOpts: {
    headers: {
      beep: 'boop'
    }
  }
}).then(() => {
  console.log('file is now downloaded!');
}).catch(err => {
  console.log('oh crap the file could not be downloaded properly');
  console.log(err);
});

download({
  // neat, tar files works as well!
  url: 'http://link-to-tarball/file.tar',
  dir: '/dir/where/file/will/be/downloaded'
}).then(() => {
  console.log('file is now downloaded!');
}).catch(err => {
  console.log('oh crap the file could not be downloaded properly');
  console.log(err);
});

```

## Tests

```sh
npm install
npm test
```

## Dependencies

- [got](https://github.com/sindresorhus/got): Simplified HTTP requests
- [gunzip-maybe](https://github.com/mafintosh/gunzip-maybe): Transform stream that gunzips its input if it is gzipped and just echoes it if not
- [object-assign](https://github.com/sindresorhus/object-assign): ES2015 `Object.assign()` ponyfill
- [promisify-function](https://github.com/jcollado/promisify-function): Turn a callback-style function into a function that returns a promise
- [pump](https://github.com/mafintosh/pump): pipe streams together and close all of them if one of them closes
- [tar-fs](https://github.com/mafintosh/tar-fs): filesystem bindings for tar-stream

## Dev Dependencies

- [babel-cli](https://github.com/babel/babel/tree/master/packages): Babel command line.
- [babel-core](https://github.com/babel/babel/tree/master/packages): Babel compiler core.
- [babel-preset-es2015](https://github.com/babel/babel/tree/master/packages): Babel preset for all es2015 plugins.
- [babel-tape-runner](https://github.com/wavded/babel-tape-runner): Babel + Tape for running your ES Next tests
- [http-test-server](https://github.com/kesla/test-http-server): Create a simple http server for tests
- [package-json-to-readme](https://github.com/zeke/package-json-to-readme): Generate a README.md from package.json contents
- [tapava](https://github.com/kesla/tapava): the syntax of ava, run through tape
- [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.
- [then-fs](https://github.com/then/fs): promised FS
- [tmp](https://github.com/raszi/node-tmp): Temporary file and directory creator
- [xo](https://github.com/sindresorhus/xo): JavaScript happiness style linter ❤️


## License

MIT

_Generated by [package-json-to-readme](https://github.com/zeke/package-json-to-readme)_

---
_Source: https://npm.io/package/download-tarball · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
