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

x/zipjs/index.js>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://deno.land/x/zipjs@v2.7.53/index.js";

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

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

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

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

exportZip(writer:
| Writer<unknown>
| 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<[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: , options?: ZipReaderConstructorOptions): Promise<[ZipEntry]>

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