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

omni-viewer-core

v0.5.0

Published

Shared parsing + rendering core for Omni Viewer (vscode / chrome / obsidian / web)

Readme

omni-viewer-core

Shared parsing and rendering core for Omni Viewer — a family of file viewers that run inside VS Code, Chrome extensions, Obsidian, and plain web pages from a single codebase.

The core is platform-agnostic: parsers take bytes and return typed document models, viewers mount into a DOM element, and everything host-specific (file access, printing, asset URLs) is injected through small interfaces.

Status: 0.x pre-release. APIs may change between minor versions.

Supported formats

  • Documents — PDF, Word (DOCX and legacy DOC), HWP, PowerPoint (PPTX and legacy PPT), Markdown
  • Data & spreadsheets — Excel, CSV/TSV, JSON, JSONL/NDJSON, YAML, TOML, Parquet, Avro, HDF5, MATLAB MAT, Protocol Buffers, ReqIF, SQLite
  • Media & graphics — audio (waveform/spectrogram), video, images, Photoshop PSD
  • Engineering & automotive — CAN DBC, AUTOSAR ARXML, ASAM A2L, Vector ASC/BLF logs, ASAM MDF 4 (MF4), PCAP/PCAPNG, ROS bag, STEP (STP)
  • Diagrams & GIS — Mermaid, PlantUML, ESRI Shapefile
  • Archives — ZIP-family listing and safe entry preview

Install

npm install omni-viewer-core

Heavy format libraries are optional peer dependencies: install only what the formats you use need (pdfjs-dist for PDF, jszip + docx-preview for Word, mermaid for Mermaid, and so on). Bundlers never have to resolve the ones you skip.

Note on xlsx (Excel / embedded workbooks)

The Excel paths require xlsx >= 0.20.2. The npm registry's xlsx package stops at 0.18.5, which has known vulnerabilities (prototype pollution, ReDoS); SheetJS distributes patched builds from its own CDN:

npm install https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz

Usage

Each format is a subpath export. Parsers are pure functions over bytes; libraries they need are injected, never imported at the top level:

import { parseExcel } from 'omni-viewer-core/parsers/excel';
import * as XLSX from 'xlsx'; // your app's copy, from the SheetJS CDN

const { result } = parseExcel(bytes, { xlsx: XLSX });
if (result.status !== 'failed') {
    console.log(result.document.sheetNames);
}

Viewers follow the same pattern — a mount*Viewer(input, container, ctx, deps) entry per format, plus self-loading variants that dynamically import their own dependencies for hosts that don't want to wire them manually.

PDF host integration

The PDF viewer asks ctx.assets.resolveAssetUrl for the exact key assets/pdfjs/pdf.worker.min.mjs. The published package also exposes that worker at omni-viewer-core/assets/pdfjs/pdf.worker.min.mjs; a host may return its own compatible pdfjs-dist worker URL instead, or pass workerSrc in the PDF mount options. isEvalSupported defaults to false for CSP-safe hosts.

PDF mount options are additive and optional. saveMode is hybrid by default (editable text/markup sidecar; signatures and deleted pages are permanent) and may be set to flattened for smaller output. toolbarActions adds host-owned buttons without exposing platform APIs to core. zoomLevels, maxMergeBytes, and onSaveAsComplete configure navigation and host save behavior.

Large save and merge work can be delegated through the optional PdfViewerDeps.processing service. VS Code extension-host and Web Worker adapters can implement buildPdf and/or mergePdfs; each receives an AbortSignal and progress callback. When the service is absent, the default auto mode preserves the browser pdf-lib fallback. host requires the service and browser forces the fallback. PdfViewerHandle.operation reports running, succeeded, failed, and cancelled states, and cancelOperation() requests cancellation.

FileSaveService.saveFile may continue resolving void for compatibility. New adapters should return { status: 'cancelled' } when a Save As picker is dismissed, or { status: 'saved', fileName?, uri? } after any host post-save work (for example opening the new file or showing a notification) completes.

Parsers never throw on malformed input; they return a ParseOutcome with a typed failure and diagnostics, and they enforce resource limits (input size, cell/row/entry counts, declared decompressed size for ZIP containers) that callers can tighten via ParseOptions.limits.

Security

This library is built to open untrusted files. See SECURITY.md for the threat model, the guarantees and their limits, and how to report a vulnerability.

License

MIT. Bundled third-party components are listed in THIRD_PARTY_NOTICES.md.