Introduction
Read Word, Excel, PowerPoint and PDF files — and show them — in TypeScript, on a server and in a browser alike.
Genom does two things, and they were built as one system. It **reads** documents — every file as a tree of blocks, as markdown, HTML or plain text, with tables that survive and charts read out as the numbers they plot. And it **shows** them — a viewer that paginates by measuring what it rendered, virtualises what is off screen, and reproduces what the author saw rather than what the file stores.
The join between the two halves is what makes it more than two libraries in a folder. Every block, chunk and range carries an address that survives being stored in a vector database and brought back months later, so a passage a retrieval system found can be scrolled to and highlighted in the document it came from rather than merely quoted beside it.
There is no Python, no WASM and no native binary anywhere. The same code runs in Node, in a browser, in a worker and on an edge runtime.
Which half are you here for
The two answers lead to different pages, and mixing them up is the most common way to end up with a bundle four times the size it needed to be.
| You want to | Start at | Runs |
|---|---|---|
| Show a document to a person | Show a document | browser |
| Get the text, markdown or structure out of a file | Read text and markdown | anywhere |
| Feed documents to a retrieval system | Chunk for retrieval | anywhere |
| Work with the parsed model — styles, sheets, slides | Parse and inspect | anywhere |
The shape of it
Ten published packages, and two rules that decide where anything lives. @genomdev/core holds what any format needs; @genomdev/office-core holds what only Word, Excel and PowerPoint need. Each format is one package covering both its generations — .doc is not a worse .docx, but it is the same package, because whoever has these files has both and did not choose.
Everything a browser needs sits behind a separate entry point — @genomdev/docx/view, @genomdev/core/dom — built with the DOM types switched off everywhere else. A server that imports @genomdev/docx never loads a line of the renderer.
@genomdev/genom the umbrella: every format, recognised without being told
@genomdev/core what any format needs
@genomdev/office-core what only Word, Excel and PowerPoint need
@genomdev/docx Word, both generations . and ./view
@genomdev/xlsx Excel, both generations . and ./view
@genomdev/pptx PowerPoint, both generations . and ./view
@genomdev/pdf PDF . and ./view
@genomdev/react @genomdev/vue @genomdev/angularThe shortest way in
Two lines to read a document, three to show one. Both are the whole API for the common case; everything else on this site is about the cases that are not common.
import { extractMarkdown } from '@genomdev/genom';
const markdown = await extractMarkdown(file);Where to go next
- Install — which of the ten packages you actually need, and why the answer is usually one or two.
- React, Vue, Angular, no framework or Node — the same viewer through five doors.
- Packages and layers — the architecture, if you want to know why it is arranged this way before you commit to it.