{"_id":"node-pptx-parser","_rev":"3-d18937c4e7d13c1900e9d9687deacb9e","name":"node-pptx-parser","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"node-pptx-parser","version":"1.0.0","keywords":["pptx","powerpoint","parser","text","extract"],"author":{"name":"Mirza-Glitch"},"license":"MIT","_id":"node-pptx-parser@1.0.0","maintainers":[{"name":"mirza-glitch","email":"mirzaglitch@gmail.com"}],"homepage":"https://github.com/Mirza-Glitch/node-pptx-parser.git","bugs":{"url":"https://github.com/Mirza-Glitch/node-pptx-parser/issues"},"dist":{"shasum":"542650c4bb56c021274de9b395401b6712a5f570","tarball":"https://registry.npmjs.org/node-pptx-parser/-/node-pptx-parser-1.0.0.tgz","fileCount":9,"integrity":"sha512-f4Tu//dCPav6Ow9hjF9EeaVwgH3MOkUale2+TniKnxT2z0cPE389kOw1pXW0/JrqRT/0KnpJXV3NOoomXuA4PA==","signatures":[{"sig":"MEUCIBLMTy1U+goQSIIoXhU6gtRPqlNhsql0E8+dkMyO05e2AiEAiQybg4xCQMARFpQ4oBI0zYGgXvymORgndmgUkMm/+ps=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30039},"main":"./dist/cjs/index.js","types":"./dist/types/index.d.ts","module":"./dist/esm/index.mjs","exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.js"}},"gitHead":"8129dda7265a60cf89a025f2c10123d3b8ee4d14","scripts":{"build":"npm run build:cjs && npm run build:esm","clean":"rimraf dist","prepack":"npm run clean && npm run build","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json && npm run rename:esm","rename:esm":"bash ./scripts/fix-mjs.sh"},"_npmUser":{"name":"mirza-glitch","email":"mirzaglitch@gmail.com"},"repository":{"url":"git+https://github.com/Mirza-Glitch/node-pptx-parser.git","type":"git"},"_npmVersion":"10.9.0","description":"A PowerPoint (PPTX) parser that extracts text content with preserved formatting","directories":{},"_nodeVersion":"22.11.0","dependencies":{"xml2js":"^0.6.2","unzipper":"^0.12.3"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.0.1","typescript":"^5.7.3","@types/node":"^22.13.4","@types/xml2js":"^0.4.14","@types/unzipper":"^0.10.10"},"_npmOperationalInternal":{"tmp":"tmp/node-pptx-parser_1.0.0_1739817438656_0.4731535126694113","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"node-pptx-parser","version":"1.0.1","keywords":["pptx","powerpoint","parser","text","extract"],"author":{"name":"Mirza-Glitch"},"license":"MIT","_id":"node-pptx-parser@1.0.1","maintainers":[{"name":"mirza-glitch","email":"mirzaglitch@gmail.com"}],"homepage":"https://github.com/Mirza-Glitch/node-pptx-parser.git","bugs":{"url":"https://github.com/Mirza-Glitch/node-pptx-parser/issues"},"dist":{"shasum":"9e7c3147360c305bd925e931786377e2ef2fb555","tarball":"https://registry.npmjs.org/node-pptx-parser/-/node-pptx-parser-1.0.1.tgz","fileCount":9,"integrity":"sha512-IhUI8U8PofZ9uh0JlD7fhUwuShbMLkAqHH7S6sGjVAc9W0NCZzq7YB3BzIkM+hYBcTqvEntU5ICOIfHZ+K0HLQ==","signatures":[{"sig":"MEYCIQDaKYXGPzLU0hIiicDAzLg+AQ9lxHBud6Im1vqsA0btFAIhAJVmCkjvqJ5zJPH8XE3Y1NYlGXxmvS+jPCtn4TedoGjF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30082},"main":"./dist/cjs/index.js","types":"./dist/types/index.d.ts","module":"./dist/esm/index.mjs","exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.mjs","require":"./dist/cjs/index.js"}},"gitHead":"666b24331f73ecb7cbf029e9d87e7a982e24041a","scripts":{"build":"npm run build:cjs && npm run build:esm","clean":"rimraf dist","prepack":"npm run clean && npm run build","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json && npm run rename:esm","rename:esm":"bash ./scripts/fix-mjs.sh"},"_npmUser":{"name":"mirza-glitch","email":"mirzaglitch@gmail.com"},"repository":{"url":"git+https://github.com/Mirza-Glitch/node-pptx-parser.git","type":"git"},"_npmVersion":"10.9.0","description":"A PowerPoint (PPTX) parser that extracts text content with preserved formatting","directories":{},"_nodeVersion":"22.11.0","dependencies":{"xml2js":"^0.6.2","unzipper":"^0.12.3"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.0.1","typescript":"^5.7.3","@types/node":"^22.13.4","@types/xml2js":"^0.4.14","@types/unzipper":"^0.10.10"},"_npmOperationalInternal":{"tmp":"tmp/node-pptx-parser_1.0.1_1739820717667_0.9452365251968129","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"_id":"node-pptx-parser@1.0.2","bugs":{"url":"https://github.com/Mirza-Glitch/node-pptx-parser/issues"},"dist":{"shasum":"c406cffd5d01d9b6e194336e86de91231f02a3d1","tarball":"https://registry.npmjs.org/node-pptx-parser/-/node-pptx-parser-1.0.2.tgz","fileCount":11,"integrity":"sha512-diex0q9W/zcS+sedoS+/RsfgbiRl9qlI+mBUQ1Gdh2lxQYhoMwsjkasSVWVmCg0O3+hXrlLjWUjy+GMXO6xFkw==","signatures":[{"sig":"MEUCIQCYHvMa6T/1dZohWHcsXxTFGXJnLGqolgqbS6kCbykhiwIgJHT7Axs244Vy+Ys8QAd9Vo12tXrloYtAhuDeaBoB5sQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGlYW8r9Ta2BjzUprLJeaBK6Lvsv7n+T7/2NPNEwZ+fOAiEAlCk1pwuH2wOTJt+i22wAeKOhRba1MpZay3JdcfclJ8o="}],"unpackedSize":34192},"main":"./dist/cjs/index.js","name":"node-pptx-parser","types":"./dist/types/index.d.ts","author":{"name":"Mirza-Glitch"},"module":"./dist/esm/index.mjs","exports":{".":{"import":{"types":"./dist/esm/index.d.mts","default":"./dist/esm/index.mjs"},"require":{"types":"./dist/types/index.d.ts","default":"./dist/cjs/index.js"}}},"gitHead":"cc1e694175e41257936d5245ac71df45892a55cf","license":"MIT","scripts":{"build":"npm run build:cjs && npm run build:esm","clean":"rimraf dist","prepack":"npm run clean && npm run build","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json && npm run rename:esm","rename:esm":"node ./scripts/fix-mjs.mjs","test:package":"npm run clean && npm run build && tsc -p tests/tsconfig.json && tsc -p tests/tsconfig.json --module node16 --moduleResolution node16 && node tests/runtime.mjs"},"version":"1.0.2","_npmUser":{"name":"mirza-glitch","email":"mirzaglitch@gmail.com"},"homepage":"https://github.com/Mirza-Glitch/node-pptx-parser.git","keywords":["pptx","powerpoint","parser","text","extract"],"repository":{"url":"git+https://github.com/Mirza-Glitch/node-pptx-parser.git","type":"git"},"_npmVersion":"10.9.3","description":"A PowerPoint (PPTX) parser that extracts text content with preserved formatting","directories":{},"maintainers":[{"name":"mirza-glitch","email":"mirzaglitch@gmail.com"}],"_nodeVersion":"22.18.0","dependencies":{"xml2js":"^0.6.2","unzipper":"^0.12.3"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.0.1","typescript":"^5.7.3","@types/node":"^22.13.4","@types/xml2js":"^0.4.14","@types/unzipper":"^0.10.10"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/node-pptx-parser_1.0.2_1795211469061_0.5169953068075782"}}},"time":{"created":"2025-02-17T18:37:18.655Z","modified":"2026-11-20T21:51:09.442Z","1.0.0":"2025-02-17T18:37:18.839Z","1.0.1":"2025-02-17T19:31:57.908Z","1.0.2":"2026-11-20T21:51:09.184Z"},"bugs":{"url":"https://github.com/Mirza-Glitch/node-pptx-parser/issues"},"author":{"name":"Mirza-Glitch"},"license":"MIT","homepage":"https://github.com/Mirza-Glitch/node-pptx-parser.git","keywords":["pptx","powerpoint","parser","text","extract"],"repository":{"url":"git+https://github.com/Mirza-Glitch/node-pptx-parser.git","type":"git"},"description":"A PowerPoint (PPTX) parser that extracts text content with preserved formatting","maintainers":[{"name":"mirza-glitch","email":"mirzaglitch@gmail.com"}],"readme":"# node-pptx-parser\n\n[![npm downloads](https://img.shields.io/npm/dm/node-pptx-parser)](https://www.npmjs.com/package/node-pptx-parser)\n[![License](https://img.shields.io/npm/l/node-pptx-parser)](https://github.com/Mirza-Glitch/node-pptx-parser/blob/main/LICENSE)\n[![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue)](https://www.typescriptlang.org/)\n\nA Node.js library for parsing PowerPoint (PPTX) files and extracting text content. This library maintains text formatting, line breaks, and paragraph structures from the original presentation.\n\n## Features\n\n- Extract text content from PPTX files with preserved formatting\n\n- Parse PPTX structure into manageable JavaScript objects\n\n- Access raw XML content of presentation components\n\n- Written in TypeScript for type safety\n\n- Promise-based API\n\n- Preserves line breaks and paragraph formatting\n\n- Minimal dependencies\n\n## Installation\n\n```bash\n\nnpm  install  node-pptx-parser\n```\n\n## Usage\n\nOnce the package is installed you can you it with `import` or `require` statements like this:\n\n```javascript\n// ESM import:\nimport PptxParser from \"node-pptx-parser\";\n\n// CommonJs require:\nconst PptxParser = require(\"node-pptx-parser\").default;\n```\n\n### Basic Text Extraction\n\n```typescript\nimport PptxParser from \"node-pptx-parser\";\n\nasync function main() {\n  const parser = new PptxParser(\"presentation.pptx\");\n\n  try {\n    // Extract text from all slides\n    const textContent = await parser.extractText();\n\n    // Print text from each slide\n    textContent.forEach((slide) => {\n      console.log(`\\nSlide ${slide.id}:`);\n\n      console.log(slide.text.join(\"\\n\"));\n    });\n  } catch (error) {\n    console.error(\"Error:\", error.message);\n  }\n}\n\nmain();\n```\n\n### Advanced Usage - Full Presentation Parsing\n\n```typescript\nimport PptxParser from \"node-pptx-parser\";\n\nasync function main() {\n  const parser = new PptxParser(\"presentation.pptx\");\n\n  try {\n    // Get complete parsed presentation content\n    const parsedContent = await parser.parse();\n\n    // Access presentation structure\n    console.log(parsedContent.presentation.parsed);\n\n    // Access individual slides\n    parsedContent.slides.forEach((slide) => {\n      console.log(`Slide ${slide.id}:`, slide.parsed);\n    });\n\n    // Access raw XML if needed\n    console.log(parsedContent.presentation.xml);\n  } catch (error) {\n    console.error(\"Error:\", error.message);\n  }\n}\n\nmain();\n```\n\n## API Reference\n\n### `PptxParser`\n\nThe main class for parsing PPTX files.\n\n#### Constructor\n\n```typescript\n\nconstructor(filePath: string)\n```\n\nCreates a new instance of PptxParser.\n\n- `filePath`: Path to the PPTX file to be parsed\n\n#### Methods\n\n##### `parse()`\n\n```typescript\n\nasync parse(): Promise<ParsedPresentation>\n```\n\nParses the entire PPTX file and returns its content.\n\n- Returns: Promise resolving to a `ParsedPresentation` object containing the complete presentation structure\n\n##### `extractText()`\n\n```typescript\n\nasync extractText(): Promise<SlideTextContent[]>\n```\n\nExtracts formatted text content from all slides.\n\n- Returns: Promise resolving to an array of `SlideTextContent` objects\n\n### Types\n\n#### `ParsedPresentation`\n\n```typescript\ninterface ParsedPresentation {\n  presentation: {\n    path: string;\n    xml: string;\n    parsed: any;\n  };\n  relationships: {\n    path: string;\n    xml: string;\n    parsed: any;\n  };\n  slides: ParsedSlide[];\n}\n```\n\n#### `ParsedSlide`\n\n```typescript\ninterface ParsedSlide {\n  id: string;\n  path: string;\n  xml: string;\n  parsed: any;\n}\n```\n\n#### `SlideTextContent`\n\n```typescript\ninterface SlideTextContent extends ParsedSlide {\n  text: string[];\n}\n```\n\n## Error Handling\n\nThe library throws errors in the following cases:\n\n- Invalid PPTX file structure\n\n- File reading errors\n\n- XML parsing errors\n\nExample error handling:\n\n```typescript\ntry {\n  const parser = new PptxParser(\"presentation.ppt\");\n  const content = await parser.extractText();\n} catch (error) {\n  if (error.message.includes(\"Invalid PPTX file structure\")) {\n    console.error(\"The PPTX file is corrupted or invalid\");\n  } else {\n    console.error(\"An error occurred:\", error.message);\n  }\n}\n```\n\n## Dependencies\n\n- unzipper: For extracting PPTX files\n- xml2js: For parsing XML content\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","readmeFilename":"README.MD"}