@dornick/parsers-office
v0.1.0
Published
Lazy DOCX and XLSX/CSV parsers for Dornick. Uses mammoth + SheetJS in the browser.
Readme
@dornick/parsers-office
Lazy DOCX + XLSX parsers for Dornick. Uses mammoth.js (Word) and SheetJS (Excel) — both in the browser, no server upload.
Install
npm i @dornick/parsers-officeDepends on mammoth (~50 KB gz) and xlsx (~600 KB gz). Both load lazily on first read.
Use
import { Dornick } from "@dornick/core";
import { docxParser, xlsxParser } from "@dornick/parsers-office";
const dornick = new Dornick({ config, transport });
dornick.parsers.add(docxParser);
dornick.parsers.add(xlsxParser);Paths produced
docxParser — .docx
| Path | Content |
|---|---|
| text.txt | Plain text (paragraphs preserved) |
| html.html | Semantic HTML (headings, lists, emphasis) |
xlsxParser — .xlsx, .xls
| Path | Content |
|---|---|
| summary.txt | Sheets, row/column counts |
| sheets/index.txt | Sheet names, one per line |
| sheets/<name>.jsonl | Rows of that sheet as JSONL objects |
The sheets/<name>.jsonl paths are dynamic — claimed via the parser's claims() method.
See also
License
MIT — © Dipankar Sarkar
