readdirp

  • Version 4.0.1
  • Published
  • 52.8 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<unknown>;

      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 {}

                  property depth

                  depth: number;

                    property files

                    files: PathOrDirent[];

                      property path

                      path: Path;

                        interface EntryInfo

                        interface EntryInfo {}

                          property basename

                          basename: string;

                            property dirent

                            dirent?: Dirent;

                              property fullPath

                              fullPath: string;

                                property path

                                path: string;

                                  property stats

                                  stats?: Stats;

                                    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 onejsDocs.io badgeto 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>