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

@neo-office/renderer

v0.1.1

Published

WASM-based Office document renderer for the browser. Parses and renders DOCX/PPTX entirely client-side via WebAssembly.

Downloads

199

Readme

@neo-office/renderer

WASM-based Office document renderer for the browser. Parses and renders DOCX, PPTX, and XLSX entirely client-side via WebAssembly — no server required.

Installation

npm install @neo-office/renderer

How It Works

The Rust engine (neo-office-wasm) is compiled to WASM and runs inside a Web Worker so the main thread is never blocked. WorkerClient is the async TypeScript interface to that worker.

Usage

import { WorkerClient } from '@neo-office/renderer';

// Point at the bundled worker file
const workerUrl = new URL('@neo-office/renderer/worker', import.meta.url);
const worker = new Worker(workerUrl, { type: 'module' });
const client = new WorkerClient(worker);

// 1. Initialise the WASM engine
await client.init();

// 2. Load a file
const bytes = new Uint8Array(await file.arrayBuffer());
const docId = await client.loadDocument(bytes);

// 3. Inspect the document
const summary  = await client.openPackage(docId);   // format, part counts
const metadata = await client.getMetadata(docId);    // author, title, …
const parsed   = await client.parseDocument(docId);  // full typed model JSON

// 4. Get page dimensions
const pages = await client.allPageInfo(docId);
// [{ width: 9144000, height: 5143500 }, …]  (EMU units for PPTX)

// 5. Render a page to an ImageData bitmap
const imageData = await client.renderPage(docId, 0, 1280, 720, 0);
// → ImageData — draw directly onto a <canvas>

// 6. Clean up
client.dispose();

API

WorkerClient

| Method | Returns | Description | |---|---|---| | init() | Promise<void> | Load and initialise the WASM engine | | loadDocument(bytes) | Promise<string> | Store raw bytes; returns a document ID | | openPackage(id) | Promise<object> | Format detection and OPC summary | | getMetadata(id) | Promise<object> | Title, author, creation date, … | | parseDocument(id) | Promise<object> | Full OOXML model as JSON | | allPageInfo(id) | Promise<PageInfo[]> | Page/slide dimensions | | layoutDocument(id) | Promise<object> | DOCX page-break layout | | renderPage(id, pageIndex, w, h, priority) | Promise<ImageData> | Rasterise one page via WASM | | cancelRender(reqId) | void | Cancel a pending render | | dispose() | void | Terminate the worker |

PageInfo

interface PageInfo {
  width: number;   // EMU for PPTX, points for DOCX
  height: number;
  name?: string;   // slide name if present
}

Bundler Notes

The worker script at @neo-office/renderer/worker must be served as a separate chunk. With Vite:

new URL('@neo-office/renderer/worker', import.meta.url)
// Vite automatically code-splits this into its own chunk

With webpack use /* webpackChunkName */ or a dynamic import.

License

MIT