node-dir/ 000755 001751 000177 0000000000 14522377323 014262 5 ustar 00runner 000000 000000 14522377323 14522377323 node-dir/LICENSE 000644 001751 000177 0000002165 14522377323 015273 0 ustar 00runner 000000 000000 14522377323 14522377323 MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
node-dir/README.md 000644 001751 000177 0000001101 14522377323 015525 0 ustar 00runner 000000 000000 14522421742 14522377323 # Installation
> `npm install --save @types/node-dir`
# Summary
This package contains type definitions for node-dir (https://github.com/fshost/node-dir).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-dir.
### Additional Details
* Last updated: Tue, 07 Nov 2023 09:09:39 GMT
* Dependencies: [@types/node](https://npmjs.com/package/@types/node)
# Credits
These definitions were written by [Panu Horsmalahti](https://github.com/panuhorsmalahti), and [James Lismore](https://github.com/jlismore).
node-dir/index.d.ts 000644 001751 000177 0000005672 14522377323 016175 0 ustar 00runner 000000 000000 14522377323 14522377323 ///
import { ReadStream } from "fs";
export interface Options {
// file encoding (defaults to 'utf8')
encoding?: string | undefined;
// a regex pattern or array to specify filenames to ignore
exclude?: RegExp | string[] | undefined;
// a regex pattern or array to specify directories to ignore
excludeDir?: RegExp | string[] | undefined;
// a regex pattern or array to specify filenames to operate on
match?: RegExp | string[] | undefined;
// a regex pattern or array to specify directories to recurse
matchDir?: RegExp | string[] | undefined;
// whether to recurse subdirectories when reading files (defaults to true)
recursive?: boolean | undefined;
// sort files in each directory in descending order
reverse?: boolean | undefined;
// whether to aggregate only the base filename rather than the full filepath
shortName?: boolean | undefined;
// sort files in each directory in ascending order (defaults to true)
sort?: boolean | undefined;
// control if done function called on error (defaults to true)
doneOnErr?: boolean | undefined;
}
export interface FileCallback {
(error: any, content: string | Buffer, next: () => void): void;
}
export interface FileNamedCallback {
(error: any, content: string | Buffer, filename: string, next: () => void): void;
}
export interface StreamCallback {
(error: any, stream: ReadStream, next: () => void): void;
}
export interface FinishedCallback {
(error: any, files: string[]): void;
}
export interface PathsResult {
files: string[];
dirs: string[];
}
export function readFiles(dir: string, fileCallback: FileCallback, finishedCallback?: FinishedCallback): void;
export function readFiles(dir: string, fileCallback: FileNamedCallback, finishedCallback?: FinishedCallback): void;
export function readFiles(
dir: string,
options: Options,
fileCallback: FileCallback,
finishedCallback?: FinishedCallback,
): void;
export function readFiles(
dir: string,
options: Options,
fileCallback: FileNamedCallback,
finishedCallback?: FinishedCallback,
): void;
export function readFilesStream(dir: string, streamCallback: StreamCallback, finishedCallback?: FinishedCallback): void;
export function readFilesStream(
dir: string,
options: Options,
streamCallback: StreamCallback,
finishedCallback?: FinishedCallback,
): void;
export function files(dir: string, callback: (error: any, files: string[]) => void): void;
export function files(dir: string, syncOption: { sync: true }): string[];
export function promiseFiles(dir: string): Promise;
export function subdirs(dir: string, callback: (error: any, subdirs: string[]) => void): void;
export function paths(dir: string, callback: (error: any, paths: PathsResult) => void): void;
export function paths(
dir: string,
combine: boolean,
callback: (error: any, paths: string[] | PathsResult) => void,
): void;
node-dir/package.json 000644 001751 000177 0000001736 14522377323 016552 0 ustar 00runner 000000 000000 14522421742 14522377323 {
"name": "@types/node-dir",
"version": "0.0.37",
"description": "TypeScript definitions for node-dir",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-dir",
"license": "MIT",
"contributors": [
{
"name": "Panu Horsmalahti",
"githubUsername": "panuhorsmalahti",
"url": "https://github.com/panuhorsmalahti"
},
{
"name": "James Lismore",
"githubUsername": "jlismore",
"url": "https://github.com/jlismore"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/node-dir"
},
"scripts": {},
"dependencies": {
"@types/node": "*"
},
"typesPublisherContentHash": "59a7dd89b21004aa6b18221c0f91af05bb0b24ad7b4f6397b1bd8dd440252ab8",
"typeScriptVersion": "4.5"
}