ZipStream

ZipStream

new ZipStream(optionsopt)

Parameters:
Name Type Attributes Description
options Object <optional>
Properties
Name Type Attributes Default Description
comment String <optional>

Sets the zip archive comment.

forceLocalTime Boolean <optional>
false

Forces the archive to contain local file times instead of UTC.

forceZip64 Boolean <optional>
false

Forces the archive to contain ZIP64 headers.

store Boolean <optional>
false

Sets the compression method to STORE.

zlib Object <optional>

Passed to zlib to control compression.

Source:

Extends

Methods

entry(source, data, callback)

Appends an entry given an input source (text string, buffer, or stream).

Parameters:
Name Type Description
source Buffer | Stream | String

The input source.

data Object
Properties
Name Type Attributes Default Description
name String

Sets the entry name including internal path.

comment String <optional>

Sets the entry comment.

date String | Date <optional>
NOW()

Sets the entry date.

mode Number <optional>
D:0755/F:0644

Sets the entry permissions.

store Boolean <optional>
options.store

Sets the compression method to STORE.

type String <optional>
file

Sets the entry type. Defaults to directory if name ends with trailing slash.

callback function
Source:
Returns:

this

finalize()

Finalizes the instance and prevents further appending to the archive structure (queue will continue til drained).

Source:
Returns:

void

getBytesWritten() → {Number}

Returns the current number of bytes written to this stream.

Source:
Returns:
Type
Number