• Version 1.0.2
  • Published
  • 41.9 kB
  • 2 dependencies
  • MIT license


npm i readdir
yarn add readdir
pnpm add readdir


Reads a directory and return results with the ability to use Ant style file match patterns




const ABSOLUTE_PATHS: number;

    variable CASE_SORT

    const CASE_SORT: number;

      variable CASELESS_SORT

      const CASELESS_SORT: number;

        variable IGNORE_ERRORS

        const IGNORE_ERRORS: number;

          variable INCLUDE_DIRECTORIES

          const INCLUDE_DIRECTORIES: number;

            variable INCLUDE_HIDDEN

            const INCLUDE_HIDDEN: number;

              variable NON_RECURSIVE

              const NON_RECURSIVE: number;


                function isDir

                isDir: (path: string) => boolean;
                • Deprecated

                function read

                read: (
                basePath: string,
                includeFilters?: string[],
                options?: OptionsConfiguration,
                handler?: ReadDirAsyncHandler
                ) => Promise<string[]>;

                  function readSync

                  readSync: (
                  basePath: string,
                  includeFilters?: Nullable<string[]>,
                  options?: OptionsConfiguration
                  ) => string[];


                    enum ReadDirOptions

                    enum ReadDirOptions {
                    ABSOLUTE_PATHS = 1,
                    CASELESS_SORT = 2,
                    CASE_SORT = 4,
                    INCLUDE_DIRECTORIES = 8,
                    INCLUDE_HIDDEN = 16,
                    NON_RECURSIVE = 32,
                    IGNORE_ERRORS = 64,

                      member ABSOLUTE_PATHS

                      ABSOLUTE_PATHS = 1
                      • Bitwise option for making the return paths absolute URIs instead of being from the supplied base path

                      member CASE_SORT

                      CASE_SORT = 4
                      • Bitwise option for making the return array sorted case sensitively

                      member CASELESS_SORT

                      CASELESS_SORT = 2
                      • Bitwise option for making the return array sorted case insensitively

                      member IGNORE_ERRORS

                      IGNORE_ERRORS = 64
                      • Bitwise option for preventing errors reading directories from aborting the scan whenever possible - includes incorrectly rooted relative symlinks and missing root directory.

                      member INCLUDE_DIRECTORIES

                      INCLUDE_DIRECTORIES = 8
                      • Bitwise option for making the return array sorted case sensitively

                      member INCLUDE_HIDDEN

                      INCLUDE_HIDDEN = 16
                      • Bitwise option for preventing the automatic removal of paths that start with a dot

                      member NON_RECURSIVE

                      NON_RECURSIVE = 32
                      • Bitwise option for preventing the directory reader running recursively

                      Package Files (3)

                      Dependencies (2)

                      Dev Dependencies (9)

                      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>