Socket
Socket
Sign inDemoInstall

node-zip

Package Overview
Dependencies
2
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-zip

node-zip - Zip/Unzip files ported from JSZip


Version published
Weekly downloads
88K
increased by4.25%
Maintainers
1
Install size
903 kB
Created
Weekly downloads
 

Readme

Source

node-zip

node-zip - Zip/Unzip files ported from JSZip

Installation

npm install node-zip

Usage

Zip:

var zip = new require('node-zip')();
zip.file('test.file', 'hello there');
var data = zip.generate({base64:false,compression:'DEFLATE'});
console.log(data); // ugly data

Unzip:

var zip = new require('node-zip')(data, {base64: false, checkCRC32: true});
console.log(zip.files['test.file']); // hello there

You can also load directly:

require('node-zip');
var zip = new JSZip(data, options)
...

Write to a file (IMPORTANT: use binary encode, thanks to @Acek)

var fs = require("fs");
zip.file('test.txt', 'hello there');
var data = zip.generate({base64:false,compression:'DEFLATE'});
fs.writeFileSync('test.zip', data, 'binary');

Testing

npm install -g jasmine-node
jasmine-node test

Manual

node-zip uses JSZip, please refer to their website for further information: http://stuartk.com/jszip/

Contributors

David Duponchel @dduponchel

Feel free to send your pull requests and contribute to this project

License

MIT

Keywords

FAQs

Last updated on 03 May 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc