npm Packages#

The project publishes three packages. Most people only install the first — the other two are the data it fetches from a CDN.

Package Version What it is Size (unpacked)
humument 0.1.0 The TypeScript library — renderer-agnostic erasure-poetry primitives. ~230 KB
humument-data 0.1.0 Per-page OCR JSON (words, bboxes, gutters, navigation graph), gzipped. ~27 MB
humument-images 0.1.0 367 normalized B&W page JPEGs (1400 × 2100). ~126 MB

humument#

The only package you install. Zero runtime dependencies. Ships ESM (dist/index.js) plus an IIFE bundle (dist/index.global.js) that exposes a HumumentLib global for no-build <script> use. See Quick Start and the Library API.

npm install humument

humument-data#

The data layer: catalog.json, search-index.json, and one gzipped JSON per printed page under db/pages/pNNNN.json.gz. humument fetches it by default from jsDelivr; you rarely reference it directly. Its exact shapes are the Data Format.

https://cdn.jsdelivr.net/npm/humument-data@0.1/db/…

humument-images#

The image layer: 367 deskewed, aligned, flat-fielded, contrast-normalized B&W JPEGs at 1400 × 2100, one per printed page. The word bounding boxes in humument-data are in these images' pixel coordinates, so drawing over a page is 1:1.

https://cdn.jsdelivr.net/npm/humument-images@0.1/pages/pNNNN.jpg

Why data and images are separate packages#

Two reasons, both about the CDN:

  • jsDelivr refuses any package over 150 MB unpacked. The images alone are ~126 MB and the raw page JSON is ~159 MB — together they'd blow the ceiling. Splitting them keeps each package comfortably under it.
  • The page JSON ships gzipped (.json.gz only), which brings the ~159 MB raw set down to ~26 MB. humument decodes it with DecompressionStream and falls back to plain .json for self-hosted exports (see Data Format → Gzip twin).

Because both are on jsDelivr and humument points at them by default, Humument.load({ page }) works from any origin with nothing self-hosted.

Versioning#

humument's CDN defaults float on the @0.1 tag of the data/images packages (CDN_DATA_BASE / CDN_IMAGE_BASE), so a data fix reaches sketches without a library release. Pin a different origin or version by passing dataBase / imageBase to Humument.load.

How they're built#

The data packages are generated, not hand-edited: data-packages/sync.mjs copies the pipeline's outputs into each package at publish time (output/dbhumument-data; data/pages_normalizedhumument-images). See The Pipeline.