MS-CFB · NAMED STREAMS

OLE2 containers
API guide

The OLE2 layer exposes compound-file directory entries and stream bytes. These primitives are shared by the format-specific helpers elsewhere in the package.

IMPLEMENTATION NOTES

What works

parseOle2 reads a compound file from an ArrayBuffer. buildOle2 serializes a map of stream paths and bytes. Path-based stream replacement edits an existing stream while preserving unrelated bytes and nested storage layout.

IMPLEMENTATION NOTES

Known limits

The container layer understands stream storage, not the internal application content of every file. Use the format guide for the actual Word, Excel, PowerPoint, Visio, or Publisher operation.

QUICK EXAMPLE

Use the supported API

Import the package root unless a subpath is shown in the sample.

OLE2 containers · TypeScript
TypeScript
import { buildOle2, parseOle2 } from '@christophervr/ole2';

const bytes = buildOle2(new Map([
  ['Example', new Uint8Array([1, 2, 3])],
]));
const file = parseOle2(bytes);
console.log(file.getStream('Example'));

This guide documents the current package API. Unsupported or unsafe operations are described explicitly; format detection alone does not imply content support.

Back to format overview