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.
- The reader handles regular and mini streams, FAT/DIFAT allocation, and directory metadata.
- Root-level SummaryInformation properties can be read, and existing text properties can be updated when they fit their allocated slots.
- Metadata writes preserve the rest of the compound file and do not create absent properties.
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.
- A stream name can identify a likely format but does not prove the file’s content is supported.
- Replacement helpers are intentionally bounded to recognized paths and safe writes.
- Metadata editing supports existing standard text properties only; it does not expand streams.
QUICK EXAMPLE
Use the supported API
Import the package root unless a subpath is shown in the sample.
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