UNPKG

@stryke/fs

Version:

A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.

47 lines (46 loc) 1.89 kB
/** * Create a directory if it does not exist. * * @param path - The directory path to check * @returns An indicator specifying if the directory exists */ export declare function createDirectorySync(path: string): string | undefined; /** * Create a directory if it does not exist. * * @param path - The directory path to check * @returns An indicator specifying if the directory exists */ export declare function createDirectory(path: string): Promise<string | undefined>; /** * Remove a directory if it exists. * * @param path - The directory path to check * @returns An indicator specifying if the directory exists */ export declare function removeDirectorySync(path: string): void; /** * Remove a directory if it exists. * * @param path - The directory path to check * @returns An indicator specifying if the directory exists */ export declare function removeDirectory(path: string): Promise<void>; /** * Extracts a file from a given tarball to the specified destination. * * @param tarballPath - The path to the tarball from where the file should be extracted. * @param file - The path to the file inside the tarball. * @param destinationFilePath - The destination file path. * @returns True if the file was extracted successfully, false otherwise. */ export declare function extractFileFromTar(tarballPath: string, file: string, destinationFilePath: string): Promise<void>; /** * Extracts a file from a given TarGzip to the specified destination. * * @param tarballPath - The path to the tarball from where the file should be extracted. * @param file - The path to the file inside the tarball. * @param destinationFilePath - The destination file path. * @returns True if the file was extracted successfully, false otherwise. */ export declare function extractFileFromTarGzip(tarballPath: string, file: string, destinationFilePath: string): Promise<void>;