fast-dir-size
Version:
Calculates the total size of a folder and its subfolders.
11 lines (10 loc) • 545 B
TypeScript
/**
* Calculates the total size of a folder and its subfolders.
* @param {string} dirPath - The path to the folder.
* @param {function} callback - A callback function that handles potential errors during the folder size calculation.
* @returns {Promise<number>} - The total size in bytes.
* @throws {TypeError} - Throws an error if the provided path is not a string.
* @since v1.2.0
*/
declare const getDirSize: (dirPath: string, callback?: ((err: Error) => void) | undefined) => Promise<number>;
export default getDirSize;