• Version 2.1.5
  • Published
  • 22.2 kB
  • 2 dependencies
  • MIT license


npm i @nodelib/fs.scandir
yarn add @nodelib/fs.scandir
pnpm add @nodelib/fs.scandir


List files and directories inside the specified directory



function scandir

scandir: typeof scandir;

    function scandirSync

    scandirSync: (path: string, optionsOrSettings?: Options | Settings) => Entry[];


      class Settings

      class Settings {}


        constructor(_options?: Options);
          readonly followSymbolicLinks: boolean;

            property fs

            readonly fs: any;

              property fsStatSettings

              readonly fsStatSettings: fsStat.Settings;

                property pathSegmentSeparator

                readonly pathSegmentSeparator: string;

                  property stats

                  readonly stats: boolean;
                    readonly throwErrorOnBrokenSymbolicLink: boolean;


                      interface Dirent

                      interface Dirent {}

                        property isBlockDevice

                        isBlockDevice: () => boolean;

                          property isCharacterDevice

                          isCharacterDevice: () => boolean;

                            property isDirectory

                            isDirectory: () => boolean;

                              property isFIFO

                              isFIFO: () => boolean;

                                property isFile

                                isFile: () => boolean;

                                  property isSocket

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

                                      property name

                                      name: string;

                                        interface Entry

                                        interface Entry {}

                                          property dirent

                                          dirent: Dirent;

                                            property name

                                            name: string;

                                              property path

                                              path: string;

                                                property stats

                                                stats?: Stats;

                                                  interface Options

                                                  interface Options {}
                                                    followSymbolicLinks?: boolean;

                                                      property fs

                                                      fs?: Partial<fs.FileSystemAdapter>;

                                                        property pathSegmentSeparator

                                                        pathSegmentSeparator?: string;

                                                          property stats

                                                          stats?: boolean;
                                                            throwErrorOnBrokenSymbolicLink?: boolean;

                                                              interface ReaddirAsynchronousMethod

                                                              interface ReaddirAsynchronousMethod {}

                                                                call signature

                                                                filepath: string,
                                                                options: {
                                                                withFileTypes: true;
                                                                callback: (error: ErrnoException | null, files: Dirent[]) => void
                                                                ): void;

                                                                  call signature

                                                                  filepath: string,
                                                                  callback: (error: ErrnoException | null, files: string[]) => void
                                                                  ): void;

                                                                    interface ReaddirSynchronousMethod

                                                                    interface ReaddirSynchronousMethod {}

                                                                      call signature

                                                                      filepath: string,
                                                                      options: {
                                                                      withFileTypes: true;
                                                                      ): Dirent[];

                                                                        call signature

                                                                        (filepath: string): string[];

                                                                          Type Aliases

                                                                          type AsyncCallback

                                                                          type AsyncCallback = async.AsyncCallback;

                                                                            type FileSystemAdapter

                                                                            type FileSystemAdapter = fsStat.FileSystemAdapter & {
                                                                            readdir: ReaddirAsynchronousMethod;
                                                                            readdirSync: ReaddirSynchronousMethod;


                                                                              namespace scandir

                                                                              namespace scandir {}

                                                                                Package Files (4)

                                                                                Dependencies (2)

                                                                                Dev Dependencies (2)

                                                                                Peer Dependencies (0)

                                                                                No peer dependencies.


                                                                                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/@nodelib/fs.scandir.

                                                                                • Markdown
                                                                                • HTML
                                                                                  <a href="https://www.jsdocs.io/package/@nodelib/fs.scandir"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>