
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
doc-textify
Advanced tools
A Node.js library to extract text from office documents (docx, pptx, xlsx, odt, odp, ods, pdf, text, html ...)
Doc-Textify is a TypeScript library and command-line tool that extracts and cleans text from various document formats.
Multi-format support:
.docx
).pptx
).xlsx
).odt
, .odp
, .ods
).pdf
).txt
).html
, .htm
)Content cleaning: removes extra whitespace, handles custom line delimiters.
Configurable options: set newline delimiter, minimum characters to extract, and toggle error logging.
Install the package and import it in your project:
npm install doc-textify --save
import { docTextify } from 'doc-textify'
// async/await version
try {
const text = await docTextify('path/to/file.pdf')
} catch (e) {
console.error(err)
}
// or callback version
docTextify('path/to/file.pdf')
.then(text => console.log(text))
.catch(err => console.error(err))
Default options:
try {
const text = await docTextify('path/to/file.pdf', {
newlineDelimiter: '\n', // output content delimiter
minCharsToExtract: 0, // number of chars required to output the content, default disabled (0)
outputErrorToConsole: true // log error to console
})
} catch (e) {
console.error(err)
}
If you prefer a ready-made command, the doc-textify
CLI wraps the same functionality:
Global install to use the doc-textify
command anywhere:
npm install -g doc-textify
Or install locally:
npm install doc-textify --save
doc-textify <path/to/document> [options]
Option | Description | Default |
---|---|---|
-n , --newlineDelimiter | Line delimiter to insert | "\n" |
-m , --minCharsToExtract | Minimum number of characters to extract | 0 (disabled) |
-h , --help | Display help message | — |
doc-textify document.docx -n "\r\n" -m 20 > output.txt
git clone https://github.com/johaven/doc-textify.git
cd doc-textify
npm install
npm run build # outputs compiled files into /dist
npm run test # test parsing
git checkout -b feature/my-feature
git commit -m "Add my feature"
git push origin feature/my-feature
This project is licensed under the MIT License.
[1.0.2] – 2025-06-07
pdfjs-dist
to 5.3.31
FAQs
A Node.js library to extract text from office documents (docx, pptx, xlsx, odt, odp, ods, pdf, text, html ...)
The npm package doc-textify receives a total of 1 weekly downloads. As such, doc-textify popularity was classified as not popular.
We found that doc-textify demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.