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

x/docxml/src/classes/Archive.ts>Archive

TypeScript (component) library for building and parsing a DOCX file
Go to Latest
class Archive
import { Archive } from "https://deno.land/x/docxml@5.3.1/src/classes/Archive.ts";

Constructors

new
Archive(zip?: JSZip)

Properties

deprecated
readonly
$fileNames
readonly
optional
location: string

Methods

addBinaryFile(location: string, promised: Promise<Uint8Array>): this

Create a new text file in the DOCX archive.

In order to keep this method (and methods that use it, eg. Docx#toArchive) synchronous, we're only writing a promise to memory for now and leave the asynchronous operations for output time (see also Archive#toUint8Array).

addJsonFile(location: string, js: any): this

Create a new JSON file in the DOCX archive.

addTextFile(location: string, contents: string): this

Create a new text file in the DOCX archive.

addXmlFile(location: string, node: Node | Document): this

Create a new XML file in the DOCX archive.

asUint8Array(): Promise<Uint8Array>
readBinary(location: string): Promise<Uint8Array>
readText(location: string): Promise<string>
readXml(location: string): Promise<Document>
toFile(location: string): Promise<void>

Static Methods

fromFile(location: string): Promise<Archive>
fromUInt8Array(data: Uint8Array)