accumulate([updateCallback])

Description : Read the whole stream and call a callback with the complete content.

Arguments

name type description
updateCallback function the function called every time the stream updates. This function is optional.

The update callback function takes 1 parameter : the metadata (see the on method).

Returns : A Promise of the full content.

Throws : Nothing.

Example

zip
.generateInternalStream({type:"uint8array"})
.accumulate(function updateCallback(metadata) {
    // metadata contains for example currentFile and percent, see the generateInternalStream doc.
}).then(function (data) {
    // data contains here the complete zip file as a uint8array (the type asked in generateInternalStream)
});