Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ZipBuilder

Builds a ZIP file.

Hierarchy

  • ZipBuilder

Index

Properties

Private Readonly _STEPS

_STEPS: ZipBuilderStep[] = []

Private _buffer

_buffer: Buffer | false = false

Methods

addBuffer

  • addBuffer(p: string, data: Buffer): this
  • Adds a buffer.

    Parameters

    • p: string

      The path in the zip file.

    • data: Buffer

      The data to write.

    Returns this

    this

addDir

  • addDir(p: string): this
  • Adds an empty directory.

    Parameters

    • p: string

      The path in the zip file.

    Returns this

    this

addFiles

  • addFiles(dir: string, basePath?: string): this
  • Adds all files of a local directory.

    Parameters

    • dir: string

      The path of the local directory.

    • Optional basePath: string

    Returns this

Private createZipInstance

  • createZipInstance(): Promise<ZipFile>

toBuffer

  • toBuffer(): Promise<Buffer>
  • Creates a new ZIP file as buffer.

    Returns Promise<Buffer>

    The promise with the buffer.

Generated using TypeDoc