zip-lib
Version:
A zip and unzip library for Node.js.
45 lines (44 loc) • 1.5 kB
TypeScript
import { type IExtractOptions } from "./unzip";
import { type IZipOptions } from "./zip";
export * from "./unzip";
export * from "./zip";
/**
* Compress a single file to a buffer.
* @param file
* @param options
*/
export declare function archiveFile(file: string, options?: IZipOptions): Promise<Buffer>;
/**
* Compress a single file to the specified zip file path.
* @param file
* @param zipFile the zip file path.
* @param options
*/
export declare function archiveFile(file: string, zipFile: string, options?: IZipOptions): Promise<void>;
/**
* Compress all the contents of the specified folder to a buffer.
* @param folder
* @param options
*/
export declare function archiveFolder(folder: string, options?: IZipOptions): Promise<Buffer>;
/**
* Compress all the contents of the specified folder to the specified zip file path.
* @param folder
* @param zipFile the zip file path.
* @param options
*/
export declare function archiveFolder(folder: string, zipFile: string, options?: IZipOptions): Promise<void>;
/**
* Extract the zip buffer to the specified location.
* @param zipBuffer
* @param targetFolder
* @param options
*/
export declare function extract(zipBuffer: Buffer, targetFolder: string, options?: IExtractOptions): Promise<void>;
/**
* Extract the zip file to the specified location.
* @param zipFile
* @param targetFolder
* @param options
*/
export declare function extract(zipFile: string, targetFolder: string, options?: IExtractOptions): Promise<void>;