JSPM

  • Created
  • Published
  • Downloads 3105518
  • Score
    100M100P100Q189121F
  • License MIT

Easily extract archives

Package Exports

  • decompress

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (decompress) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

decompress Build Status

Easily extract archives

Install

$ npm install --save decompress

Usage

var Decompress = require('decompress');

var decompress = new Decompress()
    .src('foo.zip')
    .dest('destFolder')
    .use(Decompress.zip({ strip: 1 }));

decompress.decompress();

API

new Decompress()

Creates a new Decompress instance.

.use(plugin)

Add a plugin to the middleware stack.

.src(file)

Set the file to be extract. Can be a Buffer or the path to a file.

.dest(path)

Set the destination to where your file will be extracted to.

.decompress(cb)

Extract your file with the given settings.

Plugins

The following plugins are bundled with decompress:

  • tar — Extract TAR files.
  • tar.gz — Extract TAR.GZ files.
  • zip — Extract ZIP files.

.tar()

Extract TAR files.

var Decompress = require('decompress');

var decompress = new Decompress()
    .use(Decompress.tar({ strip: 1 }));

.targz()

Extract TAR.GZ files.

var Decompress = require('decompress');

var decompress = new Decompress()
    .use(Decompress.targz({ strip: 1 }));

.zip()

Extract ZIP files.

var Decompress = require('decompress');

var decompress = new Decompress()
    .use(Decompress.zip({ strip: 1 }));

CLI

$ npm install --global decompress
$ decompress --help

Usage
  $ decompress <file> [directory]

Example
  $ decompress --strip 1 file.zip out

Options
  -s, --strip    Equivalent to --strip-components for tar

License

MIT © Kevin Mårtensson