pptx-compose
Parses Open Office XML generated PPTX to JSON
Install
$ npm install pptx-compose
Usage
; // Initialize repoconst composer = options; // Parses a PPTX file to JSONconst pptx = await composer; // Parses JSON output to PPTXconst json = await composer;
CLI
Composer is able to generate JSON from PPTX source directly from CLI, run:
# Usage: convert [options] <input> <output> # Options: # -V, --version output the version number # -i, --input PPTX File # -o, --output Output JSON file (optional) # -h, --help display help for command $ 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 = ; // Parses a PPTX file to JSONconst pptx = await composer; // Convert a PPTX file to JSON filecomposer;
.toPPTX(<json>, <options{Options & { output: string }}>)
Convert JSON file to PPTX.
const composer = '{ "my": "json" ... }'; // Parses JSON output to PPTXconst json = await composer; // Convert JSON to PPTX filecomposer;
License
MIT