Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

decompress

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

decompress - npm Package Compare versions

Comparing version 2.2.1 to 2.3.0

6

cli.js
#!/usr/bin/env node
'use strict';
var Decompress = require('./');
var fs = require('fs');
var meow = require('meow');
var stdin = require('get-stdin');
var getStdin = require('get-stdin');
var Decompress = require('./');

@@ -94,5 +94,5 @@ var cli = meow({

stdin.buffer(function (buf) {
getStdin.buffer(function (buf) {
run(buf, dest, cli.flags);
});
}
'use strict';
var bufferToVinyl = require('buffer-to-vinyl');
var combine = require('stream-combiner2');
var concat = require('concat-stream');
var vfs = require('vinyl-fs');
var streamCombiner = require('stream-combiner2');
var concatStream = require('concat-stream');
var vinylFs = require('vinyl-fs');
var vinylAssign = require('vinyl-assign');

@@ -82,3 +82,3 @@

stream.on('error', cb);
stream.pipe(concat(cb.bind(null, null)));
stream.pipe(concatStream(cb.bind(null, null)));
};

@@ -104,6 +104,6 @@

if (this.dest()) {
this.streams.push(vfs.dest(this.dest()));
this.streams.push(vinylFs.dest(this.dest()));
}
return combine(this.streams);
return streamCombiner(this.streams);
};

@@ -122,3 +122,3 @@

return vfs.src(this.src());
return vinylFs.src(this.src());
};

@@ -125,0 +125,0 @@

{
"name": "decompress",
"version": "2.2.1",
"version": "2.3.0",
"description": "Extracting archives made easy",

@@ -47,3 +47,3 @@ "license": "MIT",

"vinyl-assign": "^1.0.1",
"vinyl-fs": "^0.3.7"
"vinyl-fs": "^1.0.0"
},

@@ -50,0 +50,0 @@ "devDependencies": {

@@ -5,8 +5,10 @@ # decompress [![Build Status](http://img.shields.io/travis/kevva/decompress.svg?style=flat)](https://travis-ci.org/kevva/decompress)

## Install
```sh
```
$ npm install --save decompress
```
## Usage

@@ -17,31 +19,25 @@

var decompress = new Decompress({mode: '755'})
new Decompress({mode: '755'})
.src('foo.zip')
.dest('destFolder')
.use(Decompress.zip({strip: 1}));
.dest('dest')
.use(Decompress.zip({strip: 1}))
.run();
```
decompress.run(function (err) {
if (err) {
throw err;
}
console.log('Archive extracted successfully!');
});
```
## API
### new Decompress(opts)
### new Decompress(options)
Creates a new `Decompress` instance.
#### opts.mode
#### options.mode
Type: `String`
Type: `string`
Set mode on the extracted files, i.e `{ mode: '755' }`.
#### opts.strip
#### options.strip
Type: `Number`
Type: `number`

@@ -54,3 +50,3 @@ Equivalent to `--strip-components` for tar.

Type: `Array|Buffer|String`
Type: `array`, `buffer` or `string`

@@ -63,3 +59,3 @@ Set the files to be extracted.

Type: `String`
Type: `string`

@@ -72,16 +68,17 @@ Set the destination to where your file will be extracted to.

Type: `Function`
Type: `function`
Add a `plugin` to the middleware stack.
### .run(cb)
### .run(callback)
Extract your file with the given settings.
#### cb(err, files)
#### callback(err, files)
Type: `Function`
Type: `function`
The callback will return an array of vinyl files in `files`.
## Plugins

@@ -140,26 +137,28 @@

## CLI
```sh
```
$ npm install --global decompress
```
```sh
```
$ decompress --help
Usage
$ decompress <file> [directory]
$ cat <file> | decompress [directory]
Usage
$ decompress <file> [directory]
$ cat <file> | decompress [directory]
Example
$ decompress --strip 1 file.zip out
$ cat file.zip | decompress out
Example
$ decompress --strip 1 file.zip out
$ cat file.zip | decompress out
Options
-m, --mode Set mode on the extracted files
-s, --strip Equivalent to --strip-components for tar
Options
-m, --mode Set mode on the extracted files
-s, --strip Equivalent to --strip-components for tar
```
## License
MIT © [Kevin Mårtensson](https://github.com/kevva)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc