Socket
Socket
Sign inDemoInstall

unzipper

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unzipper - npm Package Compare versions

Comparing version 0.8.9 to 0.8.11

15

lib/parse.js

@@ -109,8 +109,3 @@ var util = require('util');

}
self.emit('entry', entry);
if (self._readableState.pipesCount)
self.push(entry);
self.pull(vars.extraFieldLength).then(function(extraField) {

@@ -132,2 +127,10 @@ var extra = binary.parse(extraField)

entry.vars = vars;
entry.extra = extra;
self.emit('entry', entry);
if (self._readableState.pipesCount)
self.push(entry);
if (self._opts.verbose)

@@ -134,0 +137,0 @@ console.log({

4

lib/parseOne.js

@@ -14,3 +14,3 @@ var Stream = require('stream');

var transform = Stream.Transform({objectMode:true});
var re = match && new RegExp(match);
var re = match instanceof RegExp ? match : (match && new RegExp(match));
var found;

@@ -59,2 +59,2 @@

module.exports = parseOne;
module.exports = parseOne;
{
"name": "unzipper",
"version": "0.8.9",
"version": "0.8.11",
"description": "Unzip cross-platform streaming API ",

@@ -38,3 +38,3 @@ "author": "Evan Oxfeld <eoxfeld@gmail.com>",

"aws-sdk": "^2.77.0",
"request": "^2.79.0",
"request": "2.79.0",
"tap": ">= 0.3.0 < 1",

@@ -41,0 +41,0 @@ "temp": ">= 0.4.0 < 1",

@@ -163,4 +163,4 @@ # unzipper [![Build Status](https://api.travis-ci.org/ZJONSSON/node-unzipper.png)](https://api.travis-ci.org/ZJONSSON/node-unzipper)

### Open.url([requestLibrary], [url])
This function will return a Promise to the central directory information from a URL point to a zipfile. Range-headers are used to avoid reading the whole file. Unzipper does not ship with a request library so you will have to provide it as the first option. The url parameter can either be a string or an object that will be passed to each request (containing the url, but also any optional properties such as cookies, proxy etc)
### Open.url([requestLibrary], [url | options])
This function will return a Promise to the central directory information from a URL point to a zipfile. Range-headers are used to avoid reading the whole file. Unzipper does not ship with a request library so you will have to provide it as the first option.

@@ -185,2 +185,24 @@ Live Example: (extracts a tiny xml file from the middle of a 500MB zipfile)

This function takes a second parameter which can either be a string containing the `url` to request, or an `options` object to invoke the supplied `request` library with. This can be used when other request options are required, such as custom heders or authentication to a third party service.
```js
const request = require('google-oauth-jwt').requestWithJWT();
const googleStorageOptions = {
url: `https://www.googleapis.com/storage/v1/b/m-bucket-name/o/my-object-name`,
qs: { alt: 'media' },
jwt: {
email: google.storage.credentials.client_email,
key: google.storage.credentials.private_key,
scopes: ['https://www.googleapis.com/auth/devstorage.read_only']
}
});
return unzipper.Open.url(request, googleStorageOptions).then((zip) => {
const file = zip.files.find((file) => file.path === 'my-filename');
return file.stream().pipe(res);
});
```
### Open.s3([aws-sdk], [params])

@@ -187,0 +209,0 @@ This function will return a Promise to the central directory information from a zipfile on S3. Range-headers are used to avoid reading the whole file. Unzipper does not ship with with the aws-sdk so you have to provide an instanciated client as first arguments. The params object requires `Bucket` and `Key` to fetch the correct file.

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