@types/get-folder-size
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -1,9 +0,85 @@ | ||
// Type definitions for get-folder-size 2.0 | ||
// Type definitions for get-folder-size 3.0 | ||
// Project: https://github.com/alessioalex/get-folder-size | ||
// Definitions by: Mariusz Szczepańczyk <https://github.com/mszczepanczyk> | ||
// Piotr Błażejewicz <https://github.com/peterblazejewicz> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
export = getFolderSize; | ||
/// <reference types="node" /> | ||
declare function getFolderSize(folder: string, callback: (err: Error | null, size: number) => void): void; | ||
declare function getFolderSize(folder: string, regexIgnorePattern: RegExp, callback: (err: Error | null, size: number) => void): void; | ||
import { PathLike } from "fs"; | ||
declare namespace getFolderSize { | ||
/** | ||
* | ||
* Returns the size of the folder. If any errors are encountered while traversing the folder, they are silently ignored. | ||
* | ||
* The returned folder size might be smaller than the real folder size. It is impossible to know for sure, since errors are ignored. | ||
* | ||
* @param itemPath - Path of the folder. | ||
* @param [options] - Options. | ||
* @param [options.ignore] - If a file's path matches this regex object, its size is not counted. | ||
* @param [options.fs] - The filesystem that should be used. Uses node fs by default. | ||
* | ||
* @returns - The size of the folder in bytes. | ||
* | ||
* @async | ||
*/ | ||
function loose(path: string, options?: Options): Promise<number>; | ||
/** | ||
* Returns the size of the folder. If any errors are encountered while traversing the folder, this method will throw an error. | ||
* | ||
* Because errors will otherwise make this method fail, the returned folder size will always be accurate. | ||
* | ||
* @param itemPath - Path of the folder. | ||
* @param [options] - Options. | ||
* @param [options.ignore] - If a file's path matches this regex object, its size is not counted. | ||
* @param [options.fs] - The filesystem that should be used. Uses node fs by default. | ||
* | ||
* @returns - The size of the folder in bytes. | ||
* | ||
* @async | ||
*/ | ||
function strict(path: string, options?: Options): Promise<number>; | ||
interface Options { | ||
ignore?: RegExp; | ||
fs?: FSLike; | ||
} | ||
interface FolderSizeInfo { | ||
size: number; | ||
errors: Error[] | null; | ||
} | ||
interface FSLike { | ||
lstat(path: PathLike, ...args: any[]): Promise<FStatsLike>; | ||
readdir(path: PathLike, ...args: any[]): Promise<string[]>; | ||
} | ||
interface FStatsLike { | ||
ino: number; | ||
size: number; | ||
isDirectory(): boolean; | ||
} | ||
} | ||
/** | ||
* Returns an object containing the size of the folder and a list of errors encountered while traversing the folder. | ||
* | ||
* If any errors are returned, the returned folder size is likely smaller than the real folder size. | ||
* | ||
* @param itemPath - Path of the folder. | ||
* @param [options] - Options. | ||
* @param [options.ignore] - If a file's path matches this regex object, its size is not counted. | ||
* @param [options.fs] - The filesystem that should be used. Uses node fs by default. | ||
* | ||
* @returns - An object containing the size of the folder in bytes and a list of encountered errors. | ||
* | ||
* @async | ||
*/ | ||
declare function getFolderSize( | ||
itemPath: PathLike, | ||
options?: getFolderSize.Options, | ||
): Promise<getFolderSize.FolderSizeInfo>; | ||
export default getFolderSize; |
{ | ||
"name": "@types/get-folder-size", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "TypeScript definitions for get-folder-size", | ||
@@ -11,13 +11,22 @@ "license": "MIT", | ||
"githubUsername": "mszczepanczyk" | ||
}, | ||
{ | ||
"name": "Piotr Błażejewicz", | ||
"url": "https://github.com/peterblazejewicz", | ||
"githubUsername": "peterblazejewicz" | ||
} | ||
], | ||
"main": "", | ||
"types": "index.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", | ||
"directory": "types/get-folder-size" | ||
}, | ||
"scripts": {}, | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "40dcdde6847f0332ef276f2d429f348945a3e481fb5cda7a3a89caf204b6f4f0", | ||
"typeScriptVersion": "2.0" | ||
"dependencies": { | ||
"@types/node": "*" | ||
}, | ||
"typesPublisherContentHash": "ab4b8d77fd1d213e4579dafe385d5e34dc8dacac7093962f2fd281dab6682aff", | ||
"typeScriptVersion": "3.5" | ||
} |
@@ -8,10 +8,10 @@ # Installation | ||
# Details | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/get-folder-size | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/get-folder-size. | ||
Additional Details | ||
* Last updated: Fri, 06 Jul 2018 00:07:02 GMT | ||
* Dependencies: none | ||
### Additional Details | ||
* Last updated: Thu, 06 May 2021 21:01:24 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node) | ||
* Global values: none | ||
# Credits | ||
These definitions were written by Mariusz Szczepańczyk <https://github.com/mszczepanczyk>. | ||
These definitions were written by [Mariusz Szczepańczyk](https://github.com/mszczepanczyk), and [Piotr Błażejewicz](https://github.com/peterblazejewicz). |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
5838
76
0
1
+ Added@types/node@*
+ Added@types/node@22.10.5(transitive)
+ Addedundici-types@6.20.0(transitive)