
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
pptx-text-parser
Advanced tools
A minimal, pure JavaScript parser for pptx files. It will extract all the text from the slides and return it as a string or a JSON object.
npm i pptx-text-parser
This module requires the following dependencies:
To extract the text as a string, use:
const pptxTextParser = require('pptx-text-parser');
pptxTextParser('path/to/pptx/file.pptx', _mode="text")
.then((text) => {
console.log(text)
return true;
}) .catch((err) => {
console.log(err);
return false;
});
To extract the text as a JSON object, use:
const pptxTextParser = require('pptx-text-parser');
pptxTextParser('path/to/pptx/file.pptx', _mode="json")
.then((textJSON) => {
console.log(textJSON);
})
.catch((err) => {
console.log(err);
});
Note: The contents of the sample.pptx
file were generated using OpenAI's ChatGPT.
You can test the module on the sample.pptx
file like so:
let sampleFilepath = "./sample.pptx";
parse(sampleFilepath, _mode="text").then((result) => {
console.log(result);
});
Switch _mode
to "json"
to get the output as a JSON object.
Note: The output is truncated for brevity. Text
"""
---
Slide 0
How giving more pets and treats to dogs can help avert the global climate crisis
Buzo
---
Slide 1
Introduction
Hello everyone, my name is Buzo and today I will be discussing how giving more pets and treats to dogs can help avert the global climate crisis. Dogs are often considered man's best friend, but they can also be a valuable ally in the fight against climate change. Let's explore how this can be possible.
---
Slide 2
The Benefits of Owning a Dog
Owning a dog has numerous benefits for both the owner and the environment. Dogs provide companionship and improve mental and physical health, leading to a happier and healthier lifestyle. Furthermore, dogs can reduce household waste and energy consumption through their natural behaviors and habits.
...
"""
JSON
{
'Slide 0': 'How giving more pets and treats to dogs can help avert the global climate crisis\n' +
'Buzo',
'Slide 1': 'Introduction\n' +
"Hello everyone, my name is Buzo and today I will be discussing how giving more pets and treats to dogs can help avert the global climate crisis. Dogs are often considered man's best friend, but they can also be a valuable ally in the fight against climate change. Let's explore how this can be possible.",
'Slide 2': 'The Benefits of Owning a Dog\n' +
'Owning a dog has numerous benefits for both the owner and the environment. Dogs provide companionship and improve mental and physical health, leading to a happier and healthier lifestyle. Furthermore, dogs can reduce household waste and energy consumption through their natural behaviors and habits.',
...
}
FAQs
Extract text from PPTX files as string or JSON.
The npm package pptx-text-parser receives a total of 918 weekly downloads. As such, pptx-text-parser popularity was classified as not popular.
We found that pptx-text-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.