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

@erzhan_npm/docx-editor-core

v2.5.4

Published

Framework-agnostic core for docx-editor.dev: OOXML parse/serialize, the canonical document tree, layout and paint, and the Editor contract the adapters render.

Readme

@docx-editor.dev/core

The engine behind docx-editor.dev. It reads a .docx into a canonical document tree, lays that tree out into pages, paints them, and writes the tree back to OOXML. No framework dependency and no UI.

Most apps never install this directly — @docx-editor.dev/react carries it. Reach for it when you are writing your own adapter, or when you need the contract types to write a function signature.

npm install @docx-editor.dev/core

Entry points

import { createDocxEditor, loadFonts, WORD_DEFAULT_FONT } from '@docx-editor.dev/core';
import type { Editor, EditorSnapshot } from '@docx-editor.dev/core';

The root covers most uses: creating an editor, the Editor contract it implements, fonts, the chrome registry, and the document model types. Subpaths expose the canonical tree, the layout pass, and the paint step directly.

| Subpath | What's there | | ------------------------- | -------------------------------------------------------------------------------------------- | | . | Create an editor, the contract, fonts, the chrome registry, the document model. | | ./editor | Everything the root re-exports, plus the paginated surface and ruler geometry. | | ./contracts/editor | Editor, EditorCommand, EditorQuery, EditorSnapshot, PageSetup. | | ./contracts/document | The document-level edit and query vocabulary. | | ./contracts/interaction | Semantic addressing (SemanticTarget) and the InteractionOutcome an attempt answers with. | | ./contracts/types | Document model types. | | ./contracts/modules | EditorModule — the shape @docx-editor.dev/pro implements. | | ./store | The canonical tree and its transactional store. | | ./layout | The DOM-free layout pass. | | ./output | Serialization. | | ./automation | The object model behind @docx-editor.dev/editor-api. | | ./styles/editor.css | The one editor stylesheet, shared by packaged and custom chrome. |

Architecture

bytes → bounded OPC/XML read → canonical OOXML tree → layout → painted pages → serialize

There is one document model. The painted pages are the editable surface: they are contenteditable, but the DOM is a picture. Browser mutations are prevented and re-expressed as tree operations, so the browser never invents markup inside your document.

Nodes are typed where layout needs them and generic everywhere else, preserving the element verbatim. Content the engine does not model is carried rather than dropped, so a document full of unknown extensions still opens, edits, and saves.

Fidelity

Untouched content, unsupported OOXML, and package payloads survive editing and save. The canonical tree preserves document structure while embedded fonts, macros, media, and other payloads pass through untouched. Two oracles gate this in CI: a canonical fingerprint over the tree, and a save-and-reopen semantic digest.

Untrusted input

A .docx is a zip of XML that whoever sent it controls end to end. The engine sanitizes at the parse boundary: URL allowlisting, entity and zip-bomb limits, recursion and element caps, no zero-click external fetches, escaping on the way back out.

Anything you render from document data (a font name, a hyperlink target, a comment body) is still attacker-controlled at your boundary. Render it as text; do not build markup or URLs from it.

Documentation

License

Apache-2.0