happy-opfs
    Preparing search index...

    Function readDirSync

    • Synchronous version of readDir. Reads the contents of a directory.

      Note: Returns DirEntryLike[] instead of AsyncIterableIterator<DirEntry> because:

      1. Sync API cannot return async iterators
      2. Native FileSystemHandle objects cannot be serialized across threads; DirEntryLike uses FileSystemHandleLike which is JSON-serializable

      Parameters

      • dirPath: string

        The absolute path of the directory to read.

      • Optionaloptions: ReadDirSyncOptions

        Optional read options (e.g., recursive).

      Returns IOResult<DirEntryLike[]>

      An IOResult containing an array of directory entries.

      readDir for the async version.

      1.1.0

      readDirSync('/documents')
      .inspect(entries => entries.forEach(e => console.log(e.path, e.handle.kind)));