Checked, typed parsing
parseOle2 returns a discriminated union of CFB, DOC, XLS, PPT and VSD documents. Ask for a specific format with expect and wrong files throw instead of being guessed.
Document models
Parse DOC, XLS, PPT and VSD files into editable TypeScript models and serialize them without losing the bytes you did not touch. No framework or runtime dependencies.
import { parseOle2 } from '@christophervr/ole2';
const document = parseOle2(bytes); // CFB | DOC | XLS | PPT | VSD
if (document.kind === 'xls') {
document.sheets[0]!.cell(1, 0).value = 'Updated';
}
const saved = document.serialize();See Getting started for installation and the format guides for what each format supports.