generateNodeStream(options[, onUpdate])

Description : Generates the complete zip file as a nodejs stream.

Arguments

name type default description
options object   the options to generate the zip file, see the options of generateAsync()
onUpdate function   The optional function called on each internal update with the metadata.

The type parameter has here the default value of nodebuffer. Only nodebuffer is currently supported.

Metadata : see the metadata of generateAsync().

Returns : a nodejs Streams3.

Throws : Nothing.

Example

zip
.generateNodeStream({streamFiles:true})
.pipe(fs.createWriteStream('out.zip'))
.on('finish', function () {
    // JSZip generates a readable stream with a "end" event,
    // but is piped here in a writable stream which emits a "finish" event.
    console.log("out.zip written.");
});