Module

x/zipjs/index.d.ts>ZipDirectoryEntry

JavaScript library to zip and unzip files supporting multi-core compression, compression streams, zip64, split files and encryption.
Latest
class ZipDirectoryEntry
extends ZipEntry
import { ZipDirectoryEntry } from "https://dotland.deno.dev/x/zipjs@v2.7.53/index.d.ts";

Represents a directory entry in the zip (Filesystem API).

Properties

directory: true

true for ZipDirectoryEntry instances.

Methods

addBlob(
name: string,
blob: Blob,
): ZipFileEntry<Blob, Blob>

Adds a entry entry with content provided as a Blob instance

addData64URI(
name: string,
dataURI: string,
): ZipFileEntry<string, string>

Adds a entry entry with content provided as a Data URI string encoded in Base64

Adds a directory

addFile(file: File, options?: ZipWriterAddDataOptions): Promise<ZipEntry>

Adds an entry with content provided via a File instance

addFileSystemEntry(fileSystemEntry: FileSystemEntryLike, options?: ZipWriterAddDataOptions): Promise<ZipEntry[]>

Adds an entry with content provided via a FileSystemEntry instance

addFileSystemHandle(fileSystemHandle: FileSystemHandleLike, options?: ZipWriterAddDataOptions): Promise<ZipEntry[]>

Adds an entry with content provided via a FileSystemHandle instance

addHttpContent(
name: string,
url: string,
): ZipFileEntry<string, void>

Adds an entry with content fetched from a URL

addReadable(
name: string,
readable: ReadableStream,
): ZipFileEntry<ReadableStream, void>

Adds a entry entry with content provided via a ReadableStream instance

addText(
name: string,
text: string,
): ZipFileEntry<string, string>

Adds an entry with content provided as text

addUint8Array(
name: string,
array: Uint8Array,
): ZipFileEntry<Uint8Array, Uint8Array>

Adds an entry with content provided as a Uint8Array instance

exportBlob(options?: ZipDirectoryEntryExportOptions): Promise<Blob>

Returns a Blob instance containing a zip file of the entry and its descendants

Returns a Data URI string encoded in Base64 containing a zip file of the entry and its descendants

exportUint8Array(options?: ZipDirectoryEntryExportOptions): Promise<Uint8Array>

Returns a Uint8Array instance containing a zip file of the entry and its descendants

exportWritable(writable?: WritableStream, options?: ZipDirectoryEntryExportOptions): Promise<WritableStream>

Creates a zip file via a WritableStream instance containing the entry and its descendants

exportZip(writer:
| Writer<unknown>
| WritableStream
| AsyncGenerator<Writer<unknown> | WritableWriter | WritableStream>
, options?: ZipDirectoryEntryExportOptions
): Promise<unknown>

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

getChildByName(name: string): ZipEntry | undefined

Gets a {@link ZipEntry} child instance from its relative filename

importBlob(blob: Blob, options?: ZipReaderConstructorOptions): Promise<[ZipEntry]>

Extracts a zip file provided as a Blob instance into the entry

importData64URI(dataURI: string, options?: ZipReaderConstructorOptions): Promise<[ZipEntry]>

Extracts a zip file provided as a Data URI string encoded in Base64 into the entry

importHttpContent(url: string, options?: ZipDirectoryEntryImportHttpOptions): Promise<[ZipEntry]>

Extracts a zip file fetched from a URL into the entry

importReadable(readable: ReadableStream, options?: ZipReaderConstructorOptions): Promise<[ZipEntry]>

Extracts a zip file provided via a ReadableStream instance into the entry

importUint8Array(array: Uint8Array, options?: ZipReaderConstructorOptions): Promise<[ZipEntry]>

Extracts a zip file provided as a Uint8Array instance into the entry

importZip(reader:
| Reader<unknown>
| ReadableStream
| Reader<unknown>[]
| ReadableStream[]
, options?: ZipReaderConstructorOptions
): Promise<[ZipEntry]>

Extracts a zip file provided via a custom Reader instance into the entry