@opfs.js/core
    Preparing search index...

    Class defaultAbstract

    Base class for OPFS file system objects (files and directories). Provides common properties such as full path, name, and parent directories.

    This class is abstract and should not be instantiated directly. Use OPFile or OPDir for working with files and directories.

    import { file } from "@opfs.js/core";

    const myFile = file("/documents/report.txt");
    await myFile.create();
    console.log(myFile.fullPath); // "/documents/report.txt"
    console.log(myFile.name); // "report.txt"
    console.log(myFile.parents); // ["documents"]

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    fullPath: string

    Full path of the file system object

    kind: FileSystemHandleKind

    Type of the file system object: "file" or "directory"

    name: string

    Name of the file or directory

    parents: string[]

    Parent directories as an array of strings

    Methods

    • Create the file or directory in OPFS.

      Returns Promise<FileSystemFileHandle | FileSystemDirectoryHandle>

      The underlying FileSystemDirectoryHandle or FileSystemFileHandle.

    • Check if the file or directory exists.

      Returns Promise<boolean>

      true if the object exists, false otherwise.

    • Remove the file or directory.

      Returns Promise<void>

      Directories may need recursive removal of all children.