An open API service indexing awesome lists of open source software.

https://github.com/ooxml-tools/file

Inspect Office Open XML files in nodejs/browser
https://github.com/ooxml-tools/file

docx ooxml pptx xlsx

Last synced: 5 months ago
JSON representation

Inspect Office Open XML files in nodejs/browser

Awesome Lists containing this project

README

          





@ooxml-tools/file

Read/write Office Open XML files in nodejs/browser.

Support for reading and writing to

- ✅ `.docx` — [WordprocessingML](http://officeopenxml.com/anatomyofOOXML.php)
- ✅ `.xlsx` — [SpreadsheetML](http://officeopenxml.com/anatomyofOOXML-xlsx.php) (coming soon)
- 👷 `.pptx` — [PresentationML](http://officeopenxml.com/anatomyofOOXML-pptx.php) (coming soon)

## Usage

The module accepts a [JSZip](https://github.com/Stuk/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());
```

## CLI

```bash
# ooxml-file [args]
#
# Commands:
# formats list valid formats
# init initializes a blank file (docx)
# pack pack directory to docx file
# unpack unpack docx to a directory
# list list files in docx
# read read file inside docx to sdtout
# write create/override file in docx
#
# 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
```

## CI

[![codecov](https://codecov.io/gh/ooxml-tools/file/graph/badge.svg?token=TZ6IV00CPW)](https://codecov.io/gh/ooxml-tools/file)

## License

MIT