happy-opfs
    Preparing search index...

    Function exists

    • Checks whether a file or directory exists at the specified path.

      Parameters

      • path: string

        The absolute path to check.

      • Optionaloptions: ExistsOptions

        Optional existence options. Set isDirectory: true to check for directory, or isFile: true to check for file. Cannot set both to true.

      Returns AsyncIOResult<boolean>

      A promise that resolves to an AsyncIOResult<boolean> indicating existence.

      1.0.0

      // Check if path exists (file or directory)
      const exists = await exists('/path/to/entry');

      // Check if path exists and is a file
      const isFile = await exists('/path/to/file', { isFile: true });

      // Check if path exists and is a directory
      const isDir = await exists('/path/to/dir', { isDirectory: true });