# got-zip

> Got a file zipped and then extracted

Latest version **0.2.6** (published 2016-02-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install got-zip
pnpm add got-zip
yarn add got-zip
bun add got-zip
```

Provides the command `got-zip`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.6 |
| Published | 2016-02-29 |
| First published | 2015-09-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+6 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | ragingwind |
| Maintainers | ragingwind |
| Keywords | got-zip, zip, got |

## Links

- npm: https://www.npmjs.com/package/got-zip
- Repository: https://github.com/ragingwind/got-zip
- Homepage: https://github.com/ragingwind/got-zip#readme
- Issues: https://github.com/ragingwind/got-zip/issues
- npm.io page: https://npm.io/package/got-zip

## Dependencies (8)

- [got](https://npm.io/package/got.md) ^4.1.1
- [meow](https://npm.io/package/meow.md) ^3.3.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [rimraf](https://npm.io/package/rimraf.md) ^2.4.2
- [minimatch](https://npm.io/package/minimatch.md) ^2.0.10
- [object-assign](https://npm.io/package/object-assign.md) ^4.0.1
- [decompress-zip](https://npm.io/package/decompress-zip.md) ^0.2.0
- [pinkie-promise](https://npm.io/package/pinkie-promise.md) ^1.0.0

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 0.2.6 (latest) — 2016-02-29
- 0.2.5 — 2015-09-27
- 0.2.4 — 2015-09-24
- 0.2.3 — 2015-09-22
- 0.2.2 — 2015-09-19
- 0.2.1 — 2015-09-19

## README

# got-zip

> Got a file zipped and then extract


## Install

```
$ npm install --save got-zip
```


## Usage

```js
var gotZip = require('got-zip');
var zip = 'https://github.com/ragingwind/got-zip/archive/v0.2.2.zip';

gotZip(zip, {
	dest: './.tmp',
	extract: true,
	cleanup: true,
	exclude: ['readme.md'],
	strip: 0
}).then(function () {
	// downloading and extracting has been completed
}).catch(function (err) {
	// manage error
});
```

## CLI

```
$ npm install --global got-zip
```

```
$ got-zip --help

  Usage
    got-zip <url> <exclude-patterns>... <options>

  Example
    got-zip http://unicorns.com/unicorns.zip 'readme.md' --dest='./.tmp' --cleanup --extract

  Options
	--dest: path to download a zip file
	--cleanup: remove the zip file after extracting
	--extract: extract the zip file after downloading
	--strip: remove leading folders in the path structure.

	<url> url of zip file trying to download
	<exclude-patterns> pattern to exclude some of the files when it is extracted
```


## API

### gotZip(input, [options])

gotZip will returns **promise**

#### url

*Required*  
Type: `string`

url of the zip file trying  to download

#### options

##### dest

Type: `string`  

path for downloading a zip file

##### extract

Type: `bool`

If set, zip will be extracted after downloading

##### cleanup

Type: `bool`

If set, zip will be deleted after extract

##### exclude

Type: `string`

You can give [patterns](https://github.com/isaacs/minimatch) to exclude some of the files when it is extracted

##### strip

Type: `number`

remove leading folders in the path structure. visit [decompress-zip](https://github.com/bower/decompress-zip) for further information.

## License

MIT © [Jimmy Moon](http://ragingwind.me)

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