OCF Package
Simple wrapper around the JSZip package to create an OCF specific packaging for EPUB.
The core of the module is in the [[OCF]] class.
The class representing the EPUB 3.4 OCF package.
- _container: JSZip
- _name: string
-
append(): voidcontent: string | ArrayBuffer | Blob | stream.Readable,path_name: string,trace?: boolean
Store a compressed content in the OCF file. The input can be a simple text or a Stream (the relevant
archiverfunction takes care of disambiguation). -
container(): JSZip
Returns the underlying ZIP container; this is used when creating a "collection", ie, when the the final content is generated from several zip containers.
- content: Buffer | ArrayBuffer | null
-
get_content(): Promise<Buffer | ArrayBuffer>
Return the final content of the book all packed up. If not yet done, the content is generated using the relevant
jszipfunction, packaging all content that has been added. -
name(): string
Return the name of the final file, as provided at constructor time. This is based on the short name of the document, or the name provided in the configuration file.
Usage
import * as mod from "lib/ocf.ts";