Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

jaguar

coderaiser3.2kMIT6.0.1

pack and extract .tar.gz archives with emitter

extract, gzip, pack, tar

readme

Jaguar License NPM version Dependency Status Build Status Coverage Status

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.
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.
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
  • Bizzy - Pack and extract .tar.bz2 archives with emitter.
  • Jag - Pack files and folders with tar and gzip.
  • OneZip - Pack and extract zip archives with emitter.
  • Tar-to-zip - Convert tar and tar.gz archives to zip.
  • Copymitter - Copy files with emitter.
  • Remy - Remove files with emitter.

License

MIT

changelog

2020.02.26, v6.0.1

feature:

  • (package) try-to-catch v3.0.0
  • (package) eslint-plugin-node v11.0.0
  • (package) nyc v15.0.0

2019.12.19, v6.0.0

feature:

  • (jaguar) drop support of node < 10
  • (package) madrun v5.0.1
  • (package) eslint-plugin-putout v3.0.0
  • (package) nodemon v2.0.2

2019.10.16, v5.0.3

feature:

  • (package) try-to-catch v2.0.0

2019.09.17, v5.0.2

feature:

  • (package) eslint-plugin-node v10.0.0
  • (package) madrun v3.0.3
  • (package) pipe-io v4.0.0

2019.08.26, v5.0.1

feature:

  • (jaguar) add madrun
  • (package) tar-stream v2.1.0
  • (package) tar-fs v2.0.0
  • (package) nyc v14.1.1
  • (package) eslint-plugin-node v9.1.0
  • (package) eslint v6.2.2
  • (package) eslint-plugin-node v8.0.0

2018.09.28, v5.0.0

feature:

  • (package) nyc v13.0.1
  • (package) drop support of node < 8
  • (package) redrun v7.0.0
  • (package) eslint-plugin-node v7.0.1
  • (package) eslint v5.6.0
  • (package) nyc v12.0.2

2018.05.08, v4.0.1

feature:

  • (jaguar) findit -> findit2

2018.05.02, v4.0.0

feature:

  • (package) pipe-io v3.0.0
  • (package) eslint-plugin-node
  • (jaguar) drop support of node < 4
  • (package) redrun v6.0.0
  • (package) coveralls v3.0.0
  • (package) nyc v11.0.2
  • (package) eslint v4.0.0

2017.01.26, v3.1.1

fix:

  • (jaguar) extract empty file

2017.01.25, v3.1.0

feature:

  • (jaguar) extract: add tar support
  • (package) nyc v10.0.0
  • (package) nyc v9.0.1

2016.11.08, v3.0.1

feature:

  • (package) pipe-io v2.0.1

2016.11.08, v3.0.0

feature:

  • (jaguar) do not emit end, when error emited

2016.11.03, v2.1.1

fix:

  • (jaguar) inheritance from EventEmitter'

2016.10.31, v2.1.0

feature:

  • (jaguar) add start event
  • (gitignore) add coverage
  • (package) add redrun

2016.10.31, v2.0.0

feature:

  • (npmignore) add
  • (jaguar) es2015-ify
  • (package) add eslint
  • (jaguar) do not emit "end" on "error"

2016.09.21, v1.1.13

feature:

  • (package) glob v7.1.0

2016.08.16, v1.1.12

fix:

  • (jaguar) extract: u -> x

2016.05.24, v1.1.11

feature:

  • (package) tar-fs v1.13.0

2016.04.11, v1.1.10

feature:

  • (package) tar-stream v1.5.1

2016.04.04, v1.1.9

feature:

  • (package) tar-fs v1.12

2016.03.07, v1.1.8

feature:

  • (package) tar-fs v1.11.1

2016.02.11, v1.1.7

feature:

  • (package) tar-fs v1.10.0
  • (package) glob v7.0.0

2015.12.21, v1.1.6

feature:

  • (package) tar-fs v1.9.0

2015.11.14, v1.1.5

feature:

  • (package) glob v6.0.1

2015.11.02, v1.1.4

feature:

  • (package) tar-stream v1.3.0

2015.09.02, v1.1.3

feature:

  • (package) tar-fs v1.8.1

2015.08.24, v1.1.2

feature:

  • feature(package) minimist v1.2.0

2015.08.17, v1.1.1

feature:

  • feature(package) pipe-io v1.2.0

2015.07.06, v1.1.0

feature:

  • (jaguar) pack: could accept stream

2015.07.06, v1.0.5

feature:

  • (jaguar) pack: add ability to use streams instead of string

2015.07.04, v1.0.4

feature:

  • (package) rm fstream
  • (package) rm test

2015.07.03, v1.0.3

fix:

  • (jaguar) crash when no such file

2015.07.02, v1.0.2

fix:

  • (jaguar) _unpack -> _extract

2015.07.02, v1.0.1

feature:

  • (jaguar) rm this._files
  • (package) unpack -> extract