Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/get-folder-size

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/get-folder-size - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

84

get-folder-size/index.d.ts

@@ -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;

19

get-folder-size/package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc