Registry / serialization / manifesto.js

manifesto.js

JSON →
library4.3.4jsnpmunverified

manifesto.js is a robust and actively maintained JavaScript/TypeScript utility library designed for interacting with the IIIF (International Image Interoperability Framework) Presentation API. It provides a comprehensive set of classes and methods for parsing, traversing, and extracting information from IIIF manifests, covering both client-side browser environments and server-side Node.js applications. The current stable version is 4.3.4. The library receives frequent updates, typically patch and minor releases, driven by dependency bumps, bug fixes, and continuous feature enhancements to align with evolving IIIF specifications, such as recent additions for IIIF Presentation v3 support including `summary` and annotations. Its key differentiators include its full adherence to IIIF Presentation API specifications, its dual utility for both frontend and backend development, and its comprehensive TypeScript type definitions, enabling robust and type-safe development workflows.

npm install manifesto.js
INSTALL
IMPORT
SIG · MANIFESTO.JS
M
manifesto.js
serializationjavascriptv4.3.4
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Manifest
✓ import { Manifest } from 'manifesto.js';
✗ import Manifest from 'manifesto.js';
All primary IIIF classes and interfaces are exported as named exports, not default.
Utils
✓ import { Utils } from 'manifesto.js';
✗ const Utils = require('manifesto.js').Utils;
The `Utils` object, containing methods like `parse`, is a named export. Ensure to use named imports for ESM environments.
IIIFResource
✓ import { IIIFResource } from 'manifesto.js';
✗ import { IResource } from 'manifesto.js';
Use the `IIIFResource` class for the base type, not an 'I' prefix interface unless specifically importing `IResource` type.

This quickstart demonstrates how to fetch, parse, and extract basic information (title, summary, first canvas details) from a IIIF manifest using manifesto.js.

import { Manifest, Utils, IIIFResource } from 'manifesto.js'; async function loadAndProcessManifest(manifestUri: string): Promise<void> { try { const response = await fetch(manifestUri); if (!response.ok) { throw new Error(`Failed to fetch manifest: ${response.statusText}`); } const manifestJson = await response.json(); // Parse the manifest using Manifesto.Utils.parse const manifest: Manifest = Utils.parse(manifestJson); console.log(`Manifest Title: ${manifest.getLabel().getValue()}`); console.log(`Manifest Summary: ${manifest.getSummary().getValue()}`); const firstCanvas = manifest.getSequences()[0]?.getCanvases()[0]; if (firstCanvas) { console.log(`First Canvas ID: ${firstCanvas.id}`); console.log(`First Canvas Label: ${firstCanvas.getLabel().getValue()}`); } else { console.log("No canvases found in the first sequence."); } } catch (error) { console.error("Error processing manifest:", error); } } // Example usage with a public IIIF manifest const exampleManifestUri = "https://iiif.bodleian.ox.ac.uk/iiif/manifest/5b3513b6-9964-469b-813c-3965682245b0.json"; loadAndProcessManifest(exampleManifestUri);
Debug
Known issues
breakingThe `IIIFResource::getDescription()` method has been deprecated in favor of `IIIFResource::getSummary()` to align with IIIF Presentation v3 specification changes.
fix
Replace calls to `resource.getDescription()` with `resource.getSummary()`.
affects: >=4.3.0
gotchaThe library upgraded to TypeScript 5 in v4.2.21. Users with older TypeScript versions or specific build configurations might encounter compilation issues.
fix
Ensure your project's TypeScript version is 5.0 or newer, or adjust your `tsconfig.json` to be compatible.
affects: >=4.2.21
gotchaWhile the `engines` field specifies Node.js `>=8.9.1`, recent CI/CD updates and dependency bumps indicate development and testing primarily target modern Node.js versions (e.g., Node 20). Using very old Node.js versions might lead to unexpected behavior or dependency conflicts.
fix
It is recommended to use a Node.js version officially supported and actively maintained, preferably Node.js 18 or 20, for optimal compatibility and security.
affects: >=4.0.0
Errors
Common errors & fixes
TypeError: Utils.parse is not a function
Attempting to access `Utils.parse` on a CommonJS `require`'d module object that doesn't correctly expose named exports directly on the default export, or incorrect destructuring in ESM.
fix
Ensure you are using named imports for ESM: `import { Utils } from 'manifesto.js';`
Property 'getDescription' does not exist on type 'IIIFResource'. Did you mean 'getSummary'?
Attempting to use the deprecated `getDescription` method on an `IIIFResource` instance after upgrading to version 4.3.0 or later.
fix
Update your code to use `IIIFResource.getSummary()` instead of `IIIFResource.getDescription()`.
Cannot find module 'manifesto.js' or its corresponding type declarations.
The package is not installed, or there's an issue with module resolution in your build environment (e.g., incorrect `tsconfig.json` paths or missing `types` in a library consuming it).
fix
Run `npm install manifesto.js` (or `yarn add manifesto.js`). Verify your TypeScript configuration if the issue persists after installation.
Upgrade
Version history
4.3.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
manifesto.js — npm install manifesto.js · libregistry