Skip to content
Genom
Start

Install

Which package you need depends on one question: do you know what file you will be handed?

If you do, install that format and nothing else — it will not bring the others. If you do not, install the umbrella, which knows all of them and fetches the one that turns up.

SituationInstallWhat arrives
Any file, format unknown@genomdev/genomAll four formats. In a browser they load on demand.
Only Word (.docx and .doc)@genomdev/docxWord, the office kernel, the core. No PDF, no spreadsheet.
Only PDF@genomdev/pdfPDF and the core. **Not** the office kernel — no ZIP, no DrawingML.
Showing documents in React@genomdev/react + a formatThe wrapper depends on no format; you choose them.

The commands

npm i @genomdev/genom
# @genomdev/core comes with it

Why the kernels are peer dependencies

@genomdev/core and @genomdev/office-core are declared as peer dependencies by every package that uses them, so npm and pnpm install exactly one copy of each. This is not tidiness. Two copies of the core mean two format registries, two ContentDocument classes and an instanceof that stops working without a single error anywhere.

npm 7+, pnpm and Bun install peer dependencies for you. Yarn does not — with Yarn, add @genomdev/core (and @genomdev/office-core for the office formats) to your own dependencies. The umbrella is the exception and depends on them normally, so npm i @genomdev/genom is one command on every package manager.

What your build has to support

Genom ships ESM only, and the entry points beyond the package root — @genomdev/docx/view, @genomdev/core/content — are subpath exports. That asks two things of the consumer, and both are satisfied by any toolchain from the last few years.

ToolNeeds
TypeScriptmoduleResolution of bundler, node16 or nodenext
BundlerVite, webpack 5, Rollup, esbuild, Parcel 2 — anything that reads exports
Node20.11 or newer
Angular21 or newer (the library is published in partial-Ivy form)
On webpack 4 and the classic resolver
Subpath exports are not understood by webpack 4, by Jest with the classic resolver, or by TypeScript on moduleResolution: "node". There is no shim for this: those toolchains cannot resolve @genomdev/docx/view at all.