zipstream
Creates ZIP output streams.
Last updated 14 years ago by wellawaretech .
Repository · Original npm · Tarball · package.json
$ cnpm install zipstream 
SYNC missed versions from official npm registry.

zipstream

Creates ZIP output streams. Depends on Node's build-in zlib module for compression.

Beware, this version is still under development. Basic functionality is in place but has not been tested in production.

Written by Antoine van Wel (website).

API

    createZip(options)  

Creates a ZipStream object. Options are passed to Zlib.

    ZipStream.addEntry(inputStream, features, callback)

Adds an entry to the ZIP stream. Features may contain "name" (mandatory).

    ZipStream.finalize()

Finalizes the ZIP.

Example

     var zipstream = require('zipstream');
     var fs = require('fs');
    
     var out = fs.createWriteStream('out.zip');
     var zip = zipstream.createZip({ level: 1 });
    
     zip.on('data', function(data) { out.write(data); });
    
     zip.addEntry(fs.createReadStream('README.md'), { name: 'README.md' }, function() {
       zip.addEntry(fs.createReadStream('example.js'), { name: 'example.js' }, function() {
         zip.finalize();
       });
     });

Current Tags

  • 0.2.1                                ...           latest (14 years ago)

5 Versions

  • 0.2.1                                ...           14 years ago
  • 0.2.0                                ...           14 years ago
  • 0.1.0                                ...           14 years ago
  • 0.0.3                                ...           14 years ago
  • 0.0.2                                ...           14 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (0)
None
Dev Dependencies (0)
None

Copyright 2013 - present © cnpmjs.org | Home |