@zip.js/zip.js
    Preparing search index...

    Class FS

    Hierarchy

    • Pick<
          ZipDirectoryEntry,
          | "getChildByName"
          | "addDirectory"
          | "addText"
          | "addBlob"
          | "addData64URI"
          | "addUint8Array"
          | "addHttpContent"
          | "addReadable"
          | "addFile"
          | "addFileSystemEntry"
          | "addFileSystemHandle"
          | "importBlob"
          | "importData64URI"
          | "importUint8Array"
          | "importHttpContent"
          | "importReadable"
          | "importZip"
          | "exportBlob"
          | "exportData64URI"
          | "exportUint8Array"
          | "exportWritable"
          | "exportFileSystemHandle"
          | "exportZip"
          | "isPasswordProtected"
          | "checkPassword",
      >
      • FS
    Index
    • Returns FS

    children: ZipEntry[]

    The children of the root directory.

    entries: (ZipEntry | null)[]

    The array of all the ZipEntry instances indexed by ZipEntry#id.

    The root directory.

    • Writes the entry and its descendants into a directory as files and sub-directories via the File System Access API (e.g. the Origin Private File System). Files are streamed and directories are merged into the target; colliding files are overwritten. This is the inverse of ZipDirectoryEntry#addFileSystemHandle.

      If an entry cannot be written, the original error is rethrown unmodified as an EntryError, whose EntryError#entryName is the name of the entry that failed, relative to this entry.

      The export is not atomic and nothing is rolled back, because the target is merged into rather than replaced: a file that already existed cannot be restored once overwritten. On failure the target is left as follows, and EntryError#exportedEntryNames lists the files that completed:

      • files written before the failure are left in place, complete and valid;
      • a file whose write started but did not finish is left empty, because it is created before its content is streamed; this includes the entry that failed and, with concurrent, every entry cancelled alongside it;
      • files that already existed in the target keep their previous content unless they were overwritten in full;
      • entries not started yet are missing, as are the directories that would have held them.

      Running the same export again is the supported way to recover, since directories are merged and files are overwritten.

      Parameters

      Returns Promise<FileSystemDirectoryHandle>

      A promise resolving to the target FileSystemDirectoryHandle instance.

    • Creates a zip file via a custom Writer instance containing the entry and its descendants

      Parameters

      Returns Promise<unknown>

      A promise resolving to the data.