npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@openparser/schema

v1.0.2

Published

Zod schemas and TypeScript types for openparser@1 documents and raw OCR envelopes

Readme

@openparser/schema

Zod schemas and TypeScript types for openparser@1 document graphs and the generic raw OCR result envelope.

Use this package to validate parse results at runtime, type document graphs in TypeScript, and share one canonical graph definition across providers and runtimes.

Full reference · OpenParser

Install

npm install @openparser/schema

Import

Import from the package root (@openparser/schema):

import {
  ParsedDocumentSchema,
  RawParseResultSchema,
  OcrOutputFormatSchema,
  type ParsedDocument,
  type RawParseResult,
  type ParsedDocumentWithElementKinds,
} from '@openparser/schema';

Validate at runtime with ParsedDocumentSchema.parse(json). Narrow adapter output with ParsedDocumentWithElementKinds<'text' | 'table'> when you know which element kinds a converter may emit.

openparser@1

The canonical result is a document graph:

  • pages define explicit coordinate spaces and reading order.
  • elements preserve text down to words/symbols plus tables, figures, formulas, key-values, query answers, selections, signatures, barcodes, links, sections, and provider-defined fallback elements.
  • relations retain hierarchy and semantic links without duplicating trees.
  • text_annotations preserve range-based languages and styles.
  • assets retain page and figure images by URI or base64 payload.
  • normalized confidence records retain their original value and scale and are explicitly uncalibrated across providers. Page-level OCR aggregates use pages[].confidence; image-quality scores/defects use pages[].quality.

text is plain reading-order text. Every span is a half-open UTF-16 code-unit range into that string, so JavaScript consumers can use text.slice(start, end) without provider-specific indexing logic. markdown is the canonical best-effort rendering of the graph; the untouched provider response remains available through the separate raw output format.

pages[].reading_order is an ordered subset of that page's element_ids and contains top-level content, not both a parent and all of its descendants. Word- and symbol-level elements are present only when the provider and requested options return them. Relation directions are explicit: contains points from parent to child, while caption_of and footnote_of point from the annotation to its target.

Geometry always includes a bounding box and may additionally retain the native polygon.

All published object schemas are strict. Adding a field or otherwise changing a shape in a way that an existing schema rejects requires a new output_format revision; openparser@1 will not silently grow incompatible fields.

Table validation rejects overlapping cells and enforces a structural row-coverage limit during overlap checks.

License

Apache-2.0