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

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.7.0 to 0.7.1

test/parsePromise.js

8

lib/parse.js

@@ -227,2 +227,10 @@ var util = require('util');

Parse.prototype.promise = function() {
var self = this;
return new Promise(function(resolve,reject) {
self.on('finish',resolve);
self.on('error',reject);
});
};
module.exports = Parse;

2

package.json
{
"name": "unzipper",
"version": "0.7.0",
"version": "0.7.1",
"description": "Unzip cross-platform streaming API ",

@@ -5,0 +5,0 @@ "author": "Evan Oxfeld <eoxfeld@gmail.com>",

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

}))
```
### Parse.promise() syntax sugar
The parser emits `finish` and `error` events like any other stream. The parser additionally provides a promise wrapper around those two events to allow easy folding into existing Promise based structures.
Example:
```js
fs.createReadStream('path/to/archive.zip')
.pipe(unzipper.Parse()
.on('entry', entry => entry.autodrain())
.promise()
.then( () => console.log('done'), e => console.log('error',e));
```
## Licenses
See LICENCE
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