pptx-compose 
Parses Open Office XML generated PPTX to JSON
Install
$ npm install pptx-compose
See changelog here for API updates and compatibility issues.
Usage
import PPTXCompose from "pptx-compose";
const composer = new PPTXCompose(options);
const pptx = await composer.toJSON("/path/to/my.pptx");
const json = await composer.toPPTX("/path/to/my.json");
CLI
Composer is able to generate JSON from PPTX source directly from CLI, run:
$ node bin/convert ./path/to/my.pptx path/to/your/directory/generated.json
Options
attribute | type | default |
---|
jszipBinary | "nodebuffer" / "base64" / "text" / "binarystring" / \ "array" / "uint8array" / "arraybuffer" / "blob" | nodebuffer |
jszipGenerateType | "nodebuffer" / "base64" / "text" / "binarystring" / \ "array" / "uint8array" / "arraybuffer" / "blob" | nodebuffer |
Methods
PPTX Composer has following built-in methods:
.toJSON(<pptx_file_path>, <options{Options & { output: string }}>)
Parse PowerPoint file to JSON.
const composer = new PPTXCompose();
const pptx = await composer.toJSON("/path/to/my.pptx");
composer.toJSON("/path/to/my.pptx", {
output: "/path/to/output/file.pptx",
});
.toPPTX(<json>, <options{Options & { output: string }}>)
Convert JSON file to PPTX.
const composer = new PPTXCompose('{ "my": "json" ... }');
const json = await composer.toPPTX("/path/to/my.json");
composer.toJSON("/path/to/my.json", {
output: "/path/to/output/file.pptx",
});
License
MIT