• Version 2.0.0
  • Published
  • 3 dependencies
  • MIT license


npm i lsr
yarn add lsr
pnpm add lsr


Recursive readdir (`ls -R`)



function lsrAsync

lsrAsync: {
(dir: string, options: Options, callback: Callback): void;
(dir: string, callback: Callback): void;
(dir: string, options?: Options): Promise<FileSystemEntry[]>;

    function lsrStream

    lsrStream: (dir: string, options: Options) => any;

      function lsrSync

      lsrSync: (dir: string, options?: Options) => Array<FileSystemEntry>;


        interface FileSystemEntry

        interface FileSystemEntry {}

          property atime

          atime: Date;

            property birthtime

            birthtime: Date;

              property blksize

              blksize: number;

                property blocks

                blocks: number;

                  property ctime

                  ctime: Date;

                    property dev

                    dev: number;

                      property fullPath

                      fullPath: string;
                      • The asbolute path to the file. Uses "/" on unix and "\" on most windows. e.g. "C:\\Users\Forbes Lidnesay\File.js"

                      property gid

                      gid: number;

                        property ino

                        ino: number;

                          property mode

                          mode: number;

                            property mtime

                            mtime: Date;

                              property name

                              name: string;
                              • The filename, e.g. "index.js"

                              nlink: number;

                                property path

                                path: string;
                                • The path relative to the starting directory. e.g. "path/to/file.js"

                                  N.B. "\" is normalized to "/" even on windows.

                                property rdev

                                rdev: number;

                                  property size

                                  size: number;

                                    property uid

                                    uid: number;

                                      method isBlockDevice

                                      isBlockDevice: () => boolean;

                                        method isCharacterDevice

                                        isCharacterDevice: () => boolean;

                                          method isDirectory

                                          isDirectory: () => boolean;

                                            method isFIFO

                                            isFIFO: () => boolean;

                                              method isFile

                                              isFile: () => boolean;

                                                method isSocket

                                                isSocket: () => boolean;
                                                  isSymbolicLink: () => boolean;

                                                    interface Options

                                                    interface Options {}

                                                      property filter

                                                      filter?: (entry: FileSystemEntry) => boolean;

                                                        property filterPath

                                                        filterPath?: (path: string) => boolean;

                                                          property highWaterMark

                                                          highWaterMark?: number;

                                                            property ignoreErrors

                                                            ignoreErrors?: boolean;

                                                              Type Aliases

                                                              type Callback

                                                              type Callback = (err: Error | void | null, result: Array<FileSystemEntry>) => void;

                                                                Package Files (1)

                                                                Dependencies (3)

                                                                Dev Dependencies (2)

                                                                Peer Dependencies (0)

                                                                No peer dependencies.


                                                                To add a badge like this badgeto your package's README, use the codes available below.

                                                                You may also use to create a custom badge linking to

                                                                • Markdown
                                                                • HTML
                                                                  <a href=""><img src="" alt=""></a>