node-zip
node-zip - Zip/Unzip files ported from JSZip
Last updated 5 years ago by daraosn .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install node-zip 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.1.1                                ...           latest (5 years ago)

5 Versions

  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.1                                ...           7 years ago
  • 0.0.2                                ...           8 years ago
  • 0.0.1                                ...           8 years ago
Maintainers (1)
Downloads
Today 61
This Week 1,057
This Month 578
Last Day 55
Last Week 848
Last Month 4,439
Dependencies (1)
Dev Dependencies (0)
None
Dependents (255)

Copyright 2014 - 2016 © taobao.org |