On this page

    M

    zlib.setMaxZipContentSize

    History
    zlib.setMaxZipContentSize(size): void
    Stability: 1.0Early development

    The ZIP archive API is experimental. Using any part of it (this function among them) emits an experimental warning the first time; merely importing node:zlib does not.

    Attributes
    size:number

    Sets the default ceiling used by zipEntry.content() when no explicit maxSize option is given. This is a guard against zip bombs: an archive whose central directory declares a member larger than this is rejected before allocating memory for it. Streaming reads (zipEntry.contentIterator(), zipFile.stream()) are bounded-memory by design and are not affected by this setting.