npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

parseflow-core

v1.7.0

Published

Document parsing library for ParseFlow - Extract text and data from PDF, Word (docx), and Excel (xlsx) files

Readme

parseflow-core

Core PDF parsing library for ParseFlow - Extract text, metadata, images, and TOC from PDF files.

npm version License: MIT


✨ Features

  • 📄 Text Extraction - Extract text from PDF with multiple strategies (raw, formatted, clean)
  • 📊 Metadata Extraction - Get title, author, page count, creation date, etc.
  • 🔍 Keyword Search - Search for specific content in PDFs with context
  • 🖼️ Image Extraction - Extract images from PDFs (requires poppler-utils)
  • 📑 Table of Contents - Extract PDF bookmarks and outline structure (requires pdftk/pdfinfo)

📦 Installation

npm install parseflow-core

Or using pnpm:

pnpm add parseflow-core

Or using yarn:

yarn add parseflow-core

🚀 Quick Start

Text Extraction

import { PDFParser } from 'parseflow-core';

const parser = new PDFParser();

// Extract all text
const result = await parser.extractText('path/to/document.pdf');
console.log(result.text);

// Extract specific page
const page2 = await parser.extractText('path/to/document.pdf', { page: 2 });

// Extract page range
const pages = await parser.extractText('path/to/document.pdf', { range: '1-5' });

Metadata Extraction

const metadata = await parser.getMetadata('path/to/document.pdf');
console.log(metadata);
// {
//   title: 'Document Title',
//   author: 'Author Name',
//   pageCount: 10,
//   creationDate: '2025-01-01',
//   ...
// }

Keyword Search

const results = await parser.searchPDF('path/to/document.pdf', 'keyword', {
  caseSensitive: false,
  maxResults: 10
});

results.forEach(result => {
  console.log(`Found on page ${result.page}: ${result.context}`);
});

Image Extraction (requires poppler-utils)

import { ImageExtractorExternal } from 'parseflow-core';

const extractor = new ImageExtractorExternal();
const images = await extractor.extract('path/to/document.pdf', './output', {
  format: 'png'
});

Table of Contents (requires pdftk or pdfinfo)

import { TOCExtractorExternal } from 'parseflow-core';

const tocExtractor = new TOCExtractorExternal();
const toc = await tocExtractor.extract('path/to/document.pdf');
console.log(toc);

📚 API Reference

PDFParser

Main parser class for PDF operations.

Methods

  • extractText(path, options?) - Extract text from PDF
  • getMetadata(path) - Get PDF metadata
  • searchPDF(path, query, options?) - Search for keywords

ImageExtractorExternal

Extract images from PDF using external tools.

Methods

  • isAvailable() - Check if pdfimages is available
  • extract(pdfPath, outputDir, options?) - Extract images

TOCExtractorExternal

Extract table of contents from PDF.

Methods

  • isAvailable() - Check if pdftk/pdfinfo is available
  • extract(pdfPath, options?) - Extract TOC

🔧 External Tools

Some features require external tools:

Image Extraction

Windows:

Linux:

sudo apt-get install poppler-utils

macOS:

brew install poppler

TOC Extraction

Windows:

  • Download Poppler (includes pdfinfo)

Linux:

sudo apt-get install poppler-utils pdftk

macOS:

brew install poppler pdftk-java

💻 Requirements

  • Node.js: >= 18.0.0
  • TypeScript: >= 5.0.0 (for development)

📖 Documentation

For complete documentation, visit:


🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.


📄 License

MIT © Libres-coder


🙏 Acknowledgments


🔗 Links


Made with ❤️ by ParseFlow Team