Read/write Office Open XML files in nodejs/browser
npm install @ooxml-tools/file
Read/write Office Open XML files in nodejs/browser.
Support for reading and writing to
- ✅ .docx — WordprocessingML
- ✅ .xlsx — SpreadsheetML (coming soon)
- 👷 .pptx — PresentationML (coming soon)
The module accepts a JSZip instance and adds some additional functionality
``js
import { open, openAsArrayBuffer } from "@ooxml-tools/file";
await zip.loadAsync(openAsArrayBuffer(docxpath));
const doc = open("docx", zip);
console.log(await docx.list());
`
`bash``ooxml-file
#Commands:
formats list valid formats
init
pack
unpack
list
read
write
#Options:
--version Show version number [boolean]
--help Show help [boolean]
#Examples:
ooxml-file init ./test.docx
ooxml-file unpack ./test.docx test.docx.unpacked
ooxml-file pack ./test.docx test.docx.unpacked
ooxml-file list ./test.docx
ooxml-file read ./test.docx word/document.xml
ooxml-file write ./test.docx word/document.xml < input.xml

MIT