happy-opfs
    Preparing search index...

    Type Alias ExistsOptions

    ExistsOptions:
        | { isDirectory?: boolean; isFile?: false }
        | { isDirectory?: false; isFile?: boolean }

    Options to determine the existence of a file or directory.

    The isDirectory and isFile options are mutually exclusive. Setting both to true will result in a compile-time error (and runtime error as fallback).

    Type Declaration

    • { isDirectory?: boolean; isFile?: false }
      • OptionalisDirectory?: boolean

        Whether to check for the existence of a directory.

        false

      • OptionalisFile?: false

        Must be false or omitted when isDirectory is true.

        false

    • { isDirectory?: false; isFile?: boolean }
      • OptionalisDirectory?: false

        Must be false or omitted when isFile is true.

        false

      • OptionalisFile?: boolean

        Whether to check for the existence of a file.

        false

    // Check if path exists (any type)
    await exists('/path');

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

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