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

mroffice-pdf

v0.2.0

Published

The MR Office PDF viewer for React: pages, thumbnails, search, presenting and comments, in the browser.

Readme

mroffice-pdf

The PDF editor of MR Office, as a React component. Pages, thumbnails, search, presenting and comments, in the browser.

  • Opens .pdf; saves the PDF as it was opened (comments stay in the page).
  • Runs in the browser on a file you hand it; nothing is sent anywhere.
npm i mroffice-pdf mroffice-core

Use

import { EditorHostProvider, browserDownloadHost, type SavedFile } from "mroffice-core";
import pdf from "mroffice-pdf";
import "mroffice-pdf/style.css";

declare const pdfBytes: Uint8Array; // a PDF's bytes (from <input type="file">, fetch(), ...)
const file = { id: "1", name: "paper.pdf", bytes: pdfBytes };
let save: () => Promise<SavedFile> | SavedFile;

export default function Editor() {
  return (
    <div style={{ height: "100vh" }}>
      <EditorHostProvider locale="en">
        <pdf.Component
          file={file}
          registerSave={(saver) => { save = saver; return () => {}; }}
          onSaveRequest={async () => { const out = await save(); browserDownloadHost.saveFile({ name: out.name, type: out.type, data: new Blob([out.bytes as BlobPart], { type: out.type }) }); }}
        />
      </EditorHostProvider>
    </div>
  );
}

The editor fills its container: give it a height. registerSave receives a function that returns the current file ({ name, type, bytes }); onSaveRequest fires on the editor's own Save (ribbon, Ctrl/Cmd+S). EditorHostProvider takes the interface language (locale: en, de, es, fr, ja, ko, zh, ... see EDITOR_LOCALES) and a host (saveFile, notify) for what the editor hands out. The default export is an EditorDefinition (extensions, newFile, Component); the component is also exported by name.

What works in the open-source build, feature by feature: packages/pdf/README.md.

Word, Excel and PowerPoint files

These packages are the open-source editors: they open and save their own formats (and HTML, Markdown, CSV, PDF). To open and save .docx, .xlsx and .pptx with full fidelity in your site, use the hosted MR Office editor: mroffice.ai/developers and the npm package mroffice-embed. The free desktop app opens them on a computer.

Next.js, webpack, Vite

The packages are ES modules with their types and a prebuilt stylesheet: no Tailwind, PostCSS or bundler settings needed. React 19 is a peer dependency.

In Next.js (App Router) the editors run in the browser only: load the component above without server rendering.

// app/editor/page.tsx
"use client";
import dynamic from "next/dynamic";
const Editor = dynamic(() => import("./Editor"), { ssr: false });
export default function Page() { return <Editor />; }

With webpack, the stylesheet import needs a CSS loader (css-loader + style-loader or mini-css-extract-plugin). Import mroffice-pdf/style.css once; every editor package's style.css is the same stylesheet.

Assets (fonts, PDF worker, dictionaries)

The installed packages hold the code and the stylesheet. The heavy files the editors fetch as they need them (the fonts that stand in for Office's, the PDF worker and its data, spelling dictionaries, the code runners' WebAssembly, the interface text in languages other than English) are the package mroffice-assets, fetched by default from jsDelivr: https://cdn.jsdelivr.net/npm/[email protected]/. Nothing to configure.

To serve them from your own site instead:

npm i -D [email protected]
cp -R node_modules/mroffice-assets public/mroffice-assets
// in a module imported before the editors
import { configureEditors } from "mroffice-core";
configureEditors({ assetsBaseUrl: "/mroffice-assets/" });

and import style.self-hosted.css in place of style.css (it leaves out the font declarations, which then come from /mroffice-assets/fonts.css; put <link rel="stylesheet" href="/mroffice-assets/fonts.css"> in the page's <head> to have them from the first paint).

License

AGPL-3.0-only with the additional terms in NOTICE.md: a copy or modified version that shows a user interface keeps a reasonable attribution to the original work (the text "MR Office" linking to https://mroffice.ai), and the names "MR Office" and "MR Note" are not licensed as trademarks. The bundled third-party code and its licenses are listed in THIRD_PARTY_NOTICES.md. A commercial license is available: [email protected].

The source is https://github.com/XinaTian/MROffice (packages/, built with npm run pack:npm).