happy-opfs
    Preparing search index...

    Function readDir

    • Reads the contents of a directory at the specified path.

      Parameters

      • dirPath: string

        The path of the directory to read.

      • Optionaloptions: ReadDirOptions

        Options of readdir.

      Returns AsyncIOResult<AsyncIterableIterator<DirEntry, any, any>>

      A promise that resolves to an AsyncIOResult containing an async iterable iterator over the entries of the directory.

      1.0.0

      readDirSync for synchronous version

      // List directory contents
      (await readDir('/documents'))
      .inspect(async entries => {
      for await (const entry of entries) {
      console.log(entry.path, entry.handle.kind);
      }
      });

      // List recursively
      await readDir('/documents', { recursive: true });