Skip to content

node-zip-rs v0.1.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 25 Dec 06:44

Breaking Changes

API naming changed.

export declare function openZipArchive(path: string): ZipArchive
export declare function openZipArchiveAsync(path: string, signal?: AbortSignal | undefined | null): Promise<ZipArchive>
export const enum CompressionMethod {
  Stored = 0,
  Deflated = 1,
  Deflate64 = 2,
  Bzip2 = 3,
  Aes = 4,
  Zstd = 5,
  Lzma = 6,
  Xz = 7
}
export interface WriteFileOptions {
  compressionMethod?: CompressionMethod
  compressionLevel?: number
  permissions?: number
  largeFile?: boolean
}
export declare function writeZip(srcDir: string, dst: string, options?: WriteFileOptions | undefined | null): void
export declare function writeZipAsync(srcDir: string, dst: string, options?: WriteFileOptions | undefined | null, signal?: AbortSignal | undefined | null): Promise<void>
export declare class ZipArchive {
  static fromBuffer(buffer: Buffer): ZipArchive
  isEmpty(): boolean
  readFile(name: string): Buffer
  readFileAsync(name: string, signal?: AbortSignal | undefined | null): Promise<Buffer>
  extract(outdir: string): void
  extractAsync(outdir: string, signal?: AbortSignal | undefined | null): Promise<void>
  fileNames(): Array<string>
}
export declare class ZipWriter {
  constructor()
  writeFile(filepath: string, realpath?: string | undefined | null, options?: WriteFileOptions | undefined | null): void
  finish(dst: string): void
  finishToBuffer(): Buffer
}