docx-core
v0.1.4
Published
Framework-neutral DOCX document model, parser and serializer (thin entry point over ooxml-core/docx)
Readme
docx-core
The DOM-free document model and file API, re-exported from the canonical OOXML core.
Live demo | npm | Full docs | Source
The framework-neutral DOCX document model, parser and preserving serializer. A thin entry point: docx-core re-exports ooxml-core/docx and docx-core/embedded re-exports ooxml-core/docx/embedded; the logic lives in ooxml-core.
Install
npm install docx-coreQuick start
import { createDocument, loadDocx, saveDocx } from 'docx-core';
const model = createDocument();
const bytes = await saveDocx(model);
const loaded = await loadDocx(bytes);API and limitations
It handles modern .docx only. To open legacy .doc files use one of the editor packages (docx-react-viewer, -vue-viewer, -angular-viewer, -svelte-viewer, -solid-viewer, -vanilla-viewer), whose loadDocument detects both formats. Saving is not lossless for unsupported features.
Documentation
License
Apache-2.0.
