# jaguar

> pack and extract .tar.gz archives with emitter

Latest version **6.0.1** (published 2020-02-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install jaguar
pnpm add jaguar
yarn add jaguar
bun add jaguar
```

Provides the command `jaguar`.

## 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 | 6.0.1 |
| Published | 2020-02-26 |
| First published | 2015-07-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.0.0 |
| Dependencies | 8 |
| Unpacked size | 17.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | coderaiser |
| Maintainers | coderaiser |
| Keywords | extract, gzip, pack, tar |

## Links

- npm: https://www.npmjs.com/package/jaguar
- Repository: https://github.com/coderaiser/node-jaguar
- Issues: https://github.com/coderaiser/node-jaguar/issues
- npm.io page: https://npm.io/package/jaguar

## Dependencies (8)

- [glob](https://npm.io/package/glob.md) ^7.1.0
- [tar-fs](https://npm.io/package/tar-fs.md) ^2.0.0
- [findit2](https://npm.io/package/findit2.md) ^2.2.3
- [pipe-io](https://npm.io/package/pipe-io.md) ^4.0.0
- [minimist](https://npm.io/package/minimist.md) ^1.2.0
- [tar-stream](https://npm.io/package/tar-stream.md) ^2.1.0
- [gunzip-maybe](https://npm.io/package/gunzip-maybe.md) ^1.3.1
- [try-to-catch](https://npm.io/package/try-to-catch.md) ^3.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

- 6.0.1 (latest) — 2020-02-26
- 6.0.0 — 2019-12-19
- 5.0.3 — 2019-10-16
- 5.0.2 — 2019-09-17
- 5.0.1 — 2019-08-26
- 5.0.0 — 2018-09-28
- 4.0.1 — 2018-05-08
- 4.0.0 — 2018-05-02
- 3.1.1 — 2017-01-26
- 3.1.0 — 2017-01-25
- 3.0.1 — 2016-11-08
- 3.0.0 — 2016-11-08
- 2.1.1 — 2016-11-03
- 2.1.0 — 2016-10-31
- 2.0.0 — 2016-10-31
- … 20 more at https://npm.io/package/jaguar/versions

## README

# Jaguar [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]

Pack and extract .tar.gz archives with emitter.

## Global

`Jaguar` could be installed global with

```
npm i jaguar -g
```

And used this way:

```
Usage: jaguar [filename]
Options:
  -h, --help      display this help and exit
  -v, --version   output version information and exit
  -p, --pack      pack files to archive
  -x, --extract   extract files from archive
```

## Local

`Jaguar` could be used localy. It will emit event on every packed/extracted file.
Good for making progress bars.

### Install

```
npm i jaguar --save
```

### How to use?

#### pack(from, to, names)

- `from`  - **string** directory that would be packed
- `to`    - **string** or **stream**, name of archive
- `names` - **array** of names in directory `from` that would be packed.

```js
const jaguar = require('jaguar');
const path = require('path');
const cwd = process.cwd();
const name = 'pipe.tar.gz';
const from = cwd + '/pipe-io';
const to = path.join(cwd, name);

const pack = jaguar.pack(from, to, [
    'LICENSE',
    'README.md',
    'package.json'
]);

pack.on('file', (name) => {
    console.log(name);
});

pack.on('start', () => {
    console.log('start of packing');
});

pack.on('progress', (percent) => {
    console.log(percent + '%');
});

pack.on('error', (error) => {
    console.error(error);
});

pack.on('end', () => {
    console.log('done');
});
```

#### extract(from, to)

- `from` - path to **.tar.gz** archive
- `to` - path to directory where files would be stored.

```js
const jaguar = require('jaguar');
const path = require('path');
const cwd = process.cwd();
const name = 'pipe.tar.gz';
const to = cwd + '/pipe-io';
const from = path.join(cwd, name);

const extract = jaguar.extract(from, to);

extract.on('file', (name) => {
    console.log(name);
});

extract.on('progress', (percent) => {
    console.log(percent + '%');
});

extract.on('error', (error) => {
    console.error(error);
});

extract.on('end', () => {
    console.log('done');
});
```


In case of starting example output should be similar to:

```
33%
67%
100%
done
```

## Related

- [Bizzy](https://github.com/coderaiser/node-bizzy "Bizzy") - Pack and extract .tar.bz2 archives with emitter.
- [Jag](https://github.com/coderaiser/node-jag "Jag") - Pack files and folders with tar and gzip.
- [OneZip](https://github.com/coderaiser/node-onezip "OneZip") - Pack and extract zip archives with emitter.
- [Tar-to-zip](https://github.com/coderaiser/node-tar-to-zip "tar-to-zip") - Convert tar and tar.gz archives to zip.
- [Copymitter](https://github.com/coderaiser/node-copymitter "Copymitter") - Copy files with emitter.
- [Remy](https://github.com/coderaiser/node-remy "Remy") - Remove files with emitter.

## License

MIT

[NPMIMGURL]:                https://img.shields.io/npm/v/jaguar.svg?style=flat
[BuildStatusIMGURL]:        https://img.shields.io/travis/coderaiser/node-jaguar/master.svg?style=flat
[DependencyStatusIMGURL]:   https://img.shields.io/david/coderaiser/node-jaguar.svg?style=flat
[LicenseIMGURL]:            https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat
[NPMURL]:                   https://npmjs.org/package/jaguar "npm"
[BuildStatusURL]:           https://travis-ci.org/coderaiser/node-jaguar  "Build Status"
[DependencyStatusURL]:      https://david-dm.org/coderaiser/node-jaguar "Dependency Status"
[LicenseURL]:               https://tldrlegal.com/license/mit-license "MIT License"

[CoverageURL]:              https://coveralls.io/github/coderaiser/node-jaguar?branch=master
[CoverageIMGURL]:           https://coveralls.io/repos/coderaiser/node-jaguar/badge.svg?branch=master&service=github

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