UNPKG

gzipper

Version:

CLI for compressing files.

45 lines (44 loc) 1.35 kB
/** * Create folders by path. */ export declare function createFolders(target: string): Promise<void>; /** * Convert Map to JSON. */ export declare function mapToJSON<K extends string, V>(map: Map<K, V>): Record<K, V>; /** * Returns package version. */ export declare function getVersion(): string; /** * Converts a long string of bytes into a readable format e.g KB, MB, GB, TB, YB */ export declare function readableSize(bytes: number): string; /** * returns readable format from hrtime. */ export declare function readableHrtime(hrTime: [number, number]): string; /** * Read file via readable stream. */ export declare function readFile(file: string): Promise<string>; /** * Splits array into equal chunks. */ export declare function chunkArray<T>(array: T[], size: number): T[][]; /** * Returns number of CPU cores. */ export declare function getCPUs(): number; /** * Filter object by predicate. */ export declare function filterObject<T>(obj: T, predicate: (key: string, item: T[Extract<keyof T, string>]) => boolean): T; /** * Returns color option based on GZIPPER_NO_COLOR and NO_COLOR vars. */ export declare function getLogColor(defaultValue?: boolean, env?: NodeJS.ProcessEnv): boolean; /** * Returns true if file exists, otherwise false. */ export declare function checkFileExists(path: string): Promise<boolean>;