readdirp
- Version 4.0.2
- Published
- 32.2 kB
- No dependencies
- MIT license
Install
npm i readdirp
yarn add readdirp
pnpm add readdirp
Overview
Recursive version of fs.readdir with streaming API.
Index
Functions
function defaultOptions
defaultOptions: () => { root: string; fileFilter: (_path: EntryInfo) => boolean; directoryFilter: (_path: EntryInfo) => boolean; type: string; lstat: boolean; depth: number; alwaysStat: boolean; highWaterMark: number;};
function readdirp
readdirp: (root: Path, options?: Partial<ReaddirpOptions>) => ReaddirpStream;
Main function which ends up calling readdirRec and reads all files and directories in given root recursively.
Parameter root
Root directory
Parameter options
Options to specify root (start directory), filters and recursion depth
function readdirpPromise
readdirpPromise: ( root: Path, options?: Partial<ReaddirpOptions>) => Promise<string[]>;
Classes
class ReaddirpStream
class ReaddirpStream extends Readable {}
constructor
constructor( options?: Partial<{ root: string; fileFilter: (_path: EntryInfo) => boolean; directoryFilter: (_path: EntryInfo) => boolean; type: string; lstat: boolean; depth: number; alwaysStat: boolean; highWaterMark: number; }>);
property parent
parent?: DirEntry;
property parents
parents: any[];
property reading
reading: boolean;
Interfaces
interface DirEntry
interface DirEntry {}
Type Aliases
type Path
type Path = string;
type PathOrDirent
type PathOrDirent = Dirent | Path;
type Predicate
type Predicate = string[] | string | Tester;
type ReaddirpOptions
type ReaddirpOptions = ReturnType<typeof defaultOptions>;
type Tester
type Tester = (path: EntryInfo) => boolean;
Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (9)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/readdirp
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/readdirp)
- HTML<a href="https://www.jsdocs.io/package/readdirp"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3428 ms. - Missing or incorrect documentation? Open an issue for this package.