function
zlib.zipFiles
Builds an archive from files on disk. For each [sourcePath, entryName] pair it reads sourcePath and adds an entry named entryName, capturing the file's Unix mode and modification time. A directory becomes a directory entry; a regular file's contents are streamed in (as a zlib.ZipEntry.createStream() entry) without being buffered in memory. Directory contents are not walked recursively - list each path you want included.
When followSymlinks is true (the default) a symbolic link is resolved and archived as its target file; when it is false the link itself is stored as a symbolic-link entry whose content is the target path (see zlib.ZipEntry.createSymlink()).
Iterable of [sourcePath, entryName] string pairs. Any iterable works - an array, a Map, the result of Object.entries(), a generator.
An archive comment, as a shorthand for { comment: options }.
stream.Readable of Buffer chunks making up the serialized archive.
Referenced types
interface ZipFilesOptions
- followSymlinks?: boolean
Resolve a symbolic link and archive the file it points to, rather than storing the link itself.