BetterOffice

Packages

What to install from npm, crates.io, and PyPI, and what each package does

Every BetterOffice package is a face on the same Rust engines — one parser, one editing core, and one layout pass per format. What changes between registries is the runtime you call them from and how much of the pipeline is exposed.

RuntimeInstallGuide
Browser, React, or Nodenpm install @betteroffice/docx-reactJavaScript
Native Rustcargo add betteroffice-docxRust
Pythonpip install betteroffice-docxPython

What exists per format

Formatnpmcrates.ioPyPI
DOCX@betteroffice/docx, @betteroffice/docx-reactbetteroffice-docxbetteroffice-docx
XLSX@betteroffice/xlsx, @betteroffice/xlsx-reactbetteroffice-xlsxbetteroffice-xlsx
PPTX@betteroffice/pptx, @betteroffice/pptx-reactbetteroffice-pptxbetteroffice-pptx

All three registries carry all three formats.

Fonts

Word documents overwhelmingly reference the MS core fonts, whose binaries cannot be redistributed. These packages ship the open metric-compatible replacements — same advance widths, so line breaks and pagination match Word.

PackageSizeContents
@betteroffice/fonts7.9 MBCarlito, Caladea, Liberation Sans/Serif/Mono, Noto Hebrew/Arabic
@betteroffice/fonts-cjk33 MBNoto Sans SC/TC/JP/KR, Noto Serif SC

npm install @betteroffice/fonts is the whole setup: @betteroffice/docx picks it up through an optional dynamic import, so measurement uses real font metrics with no wiring. Add @betteroffice/fonts-cjk only for Chinese, Japanese, or Korean text — it is separate so nobody installs 33 MB they do not need.

Without either, families a document does not embed measure with synthetic metrics and pagination will not match Word. Neither package is installed automatically; both are declared optional peers.

Picking one

  • An editor UI in a React app — the -react packages. They own the toolbar, canvas, selection, keyboard, and review UI.
  • Your own UI in the browser — the framework-free cores. Same engine, no React: display lists, hit-testing, and a document handle.
  • A server, a CLI, or a pipeline in Rust — the three facade crates.
  • A server, a notebook, or an agent in Python — the three betteroffice-* distributions on PyPI.
  • One stage of the pipeline — the per-layer crates, published individually.

Versions are 0.0.x and the APIs are still settling. Breaking changes are listed in each package's changelog.

On this page