├── .editorconfig
├── .gitattributes
├── .github
└── workflows
│ ├── pull-request.yml
│ └── release.yml
├── .gitignore
├── .prettierrc
├── .releaserc.json
├── .travis.yml
├── README.md
├── bin
└── convert
├── jest.config.json
├── lib
├── index.d.ts
├── index.js
├── index.js.map
├── parser.d.ts
├── parser.js
├── parser.js.map
├── types.d.ts
├── types.js
└── types.js.map
├── package-lock.json
├── package.json
├── src
├── __tests__
│ ├── fixtures
│ │ ├── sample.jpg
│ │ ├── sample.pptx
│ │ └── sample.zip
│ ├── index.spec.ts
│ └── parser.spec.ts
├── index.ts
├── parser.ts
└── types.ts
└── tsconfig.json
/.editorconfig:
--------------------------------------------------------------------------------
1 | # For more information about the configurations used
2 | # in this file, please see the EditorConfig documentation:
3 | # http://editorconfig.org
4 |
5 | root = true
6 |
7 | [*]
8 | charset = utf-8
9 | indent_size = 2
10 | indent_style = space
11 | insert_final_newline = true
12 | trim_trailing_whitespace = true
13 |
14 | [*.scss]
15 | indent_size = 2
16 |
17 | [*.md]
18 | trim_trailing_whitespace = false
19 |
20 | [{package.json}]
21 | indent_size = 2
22 | indent_style = space
23 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | *.js text eol=lf
3 |
--------------------------------------------------------------------------------
/.github/workflows/pull-request.yml:
--------------------------------------------------------------------------------
1 | name: Pull Request
2 | on: pull_request
3 |
4 | jobs:
5 | build:
6 | name: PR Checker
7 | runs-on: ubuntu-18.04
8 | if: "!contains(github.event.head_commit.message, '[skip ci]')"
9 |
10 | steps:
11 | # checkout branch
12 | - name: Checkout
13 | uses: actions/checkout@v2
14 |
15 | # setup node
16 | - name: Setup Node.js
17 | uses: actions/setup-node@v1
18 | with:
19 | node-version: 12
20 |
21 | # install deps
22 | - name: Install dependencies
23 | run: npm ci
24 |
25 | # run tests
26 | - name: Run tests
27 | run: npm run test
28 |
29 | # build lib
30 | - name: Build library
31 | run: npm run build
32 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 | on:
3 | push:
4 | branches:
5 | - master
6 | jobs:
7 | release:
8 | name: Library Release
9 | runs-on: ubuntu-18.04
10 | if: "!contains(github.event.head_commit.message, '[skip ci]')"
11 |
12 | steps:
13 | # checkout branch
14 | - name: Checkout
15 | uses: actions/checkout@v2
16 |
17 | # setup node
18 | - name: Setup Node.js
19 | uses: actions/setup-node@v1
20 | with:
21 | node-version: 12
22 |
23 | # install deps
24 | - name: Install dependencies
25 | run: npm ci
26 |
27 | # build lib
28 | - name: Build library
29 | run: npm run build
30 |
31 | # run tests
32 | - name: Run tests
33 | run: npm run test
34 |
35 | # release new version
36 | - name: Release
37 | env:
38 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
40 | run: npx semantic-release
41 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | lerna-debug.log*
8 | .DS_Store
9 |
10 | # Diagnostic reports (https://nodejs.org/api/report.html)
11 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12 |
13 | # Runtime data
14 | pids
15 | *.pid
16 | *.seed
17 | *.pid.lock
18 |
19 | # Directory for instrumented libs generated by jscoverage/JSCover
20 | lib-cov
21 |
22 | # Coverage directory used by tools like istanbul
23 | coverage
24 | *.lcov
25 |
26 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
27 | .grunt
28 |
29 | # Bower dependency directory (https://bower.io/)
30 | bower_components
31 |
32 | # node-waf configuration
33 | .lock-wscript
34 |
35 | # Compiled binary addons (https://nodejs.org/api/addons.html)
36 | build/Release
37 |
38 | # Dependency directories
39 | node_modules/
40 | jspm_packages/
41 |
42 | # TypeScript v1 declaration files
43 | typings/
44 |
45 | # TypeScript cache
46 | *.tsbuildinfo
47 |
48 | # Optional npm cache directory
49 | .npm
50 |
51 | # Optional eslint cache
52 | .eslintcache
53 |
54 | # Optional REPL history
55 | .node_repl_history
56 |
57 | # Output of 'npm pack'
58 | *.tgz
59 |
60 | # Yarn Integrity file
61 | .yarn-integrity
62 | yarn.lock
63 |
64 | # dotenv environment variables file
65 | .env
66 | .env.test
67 |
68 | # parcel-bundler cache (https://parceljs.org/)
69 | .cache
70 |
71 | # Gatsby files
72 | .cache/
73 | # Comment in the public line in if your project uses Gatsby and *not* Next.js
74 | # https://nextjs.org/blog/next-9-1#public-directory-support
75 | # public
76 | # DynamoDB Local files
77 | .dynamodb/
78 |
79 | # TernJS port file
80 | .tern-port
81 |
82 | # Built files
83 | dist/
84 | output/
85 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "useTabs": false,
3 | "tabWidth": 2,
4 | "printWidth": 120,
5 | "semi": true
6 | }
7 |
--------------------------------------------------------------------------------
/.releaserc.json:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | [
4 | "semantic-release-gitmoji",
5 | {
6 | "releaseRules": {
7 | "patch": {
8 | "include": [":bento:", ":recycle:"]
9 | }
10 | }
11 | }
12 | ],
13 | "@semantic-release/github",
14 | "@semantic-release/npm",
15 | [
16 | "@semantic-release/git",
17 | {
18 | "message": ":bookmark: v${nextRelease.version} [skip ci]\n\nhttps://github.com/shobhitsharma/pptx-compose/releases/tag/${nextRelease.gitTag}"
19 | }
20 | ]
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "node"
4 | script:
5 | - "npm run build"
6 | - "npm run test:report"
7 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # pptx-compose [](https://badge.fury.io/js/pptx-compose)
2 |
3 | > Parses Open Office XML generated PPTX to JSON
4 |
5 | ## Install
6 |
7 | ```
8 | $ npm install pptx-compose
9 | ```
10 |
11 | See [changelog here](https://github.com/shobhitsharma/pptx-compose/releases) for API updates and compatibility issues.
12 |
13 | ## Usage
14 |
15 | ```js
16 | import PPTXCompose from "pptx-compose";
17 |
18 | // Initialize repo
19 | const composer = new PPTXCompose(options);
20 |
21 | // Parses a PPTX file to JSON
22 | const pptx = await composer.toJSON("/path/to/my.pptx");
23 |
24 | // Parses JSON output to PPTX
25 | const json = await composer.toPPTX("/path/to/my.json");
26 | ```
27 |
28 | ## CLI
29 |
30 | Composer is able to generate JSON from PPTX source directly from CLI, run:
31 |
32 | ```bash
33 | # Usage: convert [options]