Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/zipjs/index.d.ts>ZipDirectoryEntry

JavaScript library to zip and unzip files supporting multi-core compression, compression streams, Zip64 and encryption.
Go to Latest
class ZipDirectoryEntry
extends ZipEntry
import { ZipDirectoryEntry } from "https://deno.land/x/zipjs@v2.6.55/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 aentry entry with content provided as a Blob instance

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

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

Adds a directory

addFileSystemEntry(fileSystemEntry: FileSystemEntry): Promise<ZipEntry>

Adds an entry with content provided via a FileSystemEntry instance

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

Adds an entry with content fetched from a URL

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

Adds aentry 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

exportData64URI(options?: ZipDirectoryEntryExportOptions): Promise<string>

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>
| WritableWriter
| 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 ZipEntry child instance from its relative filename

importBlob(blob: Blob, options?: ZipReaderConstructorOptions): Promise<void>

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

importData64URI(dataURI: string, options?: ZipReaderConstructorOptions): Promise<void>

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

importHttpContent(url: string, options?: ZipDirectoryEntryImportHttpOptions): Promise<void>

Extracts a zip file fetched from a URL into the entry

importReadable(readable: ReadableStream, options?: ZipReaderConstructorOptions): Promise<void>

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

importUint8Array(array: Uint8Array, options?: ZipReaderConstructorOptions): Promise<void>

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

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

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