UNPKG

dir-archiver

Version:

Compress a whole directory (including subdirectories) into a zip file, with options to exclude specific files, or directories.

29 lines (28 loc) 1.35 kB
declare class DirArchiver { private excludedPaths; private excludedNames; private caseInsensitiveExcludes; private directoryPath; private zipPath; private includeBaseDirectory; private followSymlinks; private baseDirectory; private visitedDirectories; /** * The constructor. * @param directoryPath - the path of the folder to archive. * @param zipPath - The path of the zip file to create. * @param includeBaseDirectory - Includes a base directory at the root of the archive. For example, if the root folder of your project is named "your-project", setting includeBaseDirectory to true will create an archive that includes this base directory. If this option is set to false the archive created will unzip its content to the current directory. * @param excludes - The name of the files and foldes to exclude. */ constructor(directoryPath: string, zipPath: string, includeBaseDirectory?: boolean, excludes?: string[], followSymlinks?: boolean); /** * Recursively traverse the directory tree and append the files to the archive. * @param directoryPath - The path of the directory being looped through. */ private traverseDirectoryTree; private prettyBytes; private normalizeExcludeValue; createZip(): Promise<string>; } export = DirArchiver;