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 🙏

© 2026 – Pkg Stats / Ryan Hefner

any-extractor

v3.1.0

Published

Turn any document (PDF, Word, Excel, PowerPoint, OpenDocument, HTML, JSON, CSV, text) into agent-ready markdown, typed blocks, and metadata — one call, with an optional custom-parser hook for vision LLMs and bespoke formats.

Downloads

118

Readme

any-extractor

One extract() call. Any document. Agent-ready markdown, typed blocks, and metadata.

npm version license Downloads

Point it at a file, URL, or Buffer. Get back:

  • markdown — a single GFM string, ready for an LLM.
  • text — plain reading-order text, ready for embeddings or search.
  • sections — ordered pages / slides / sheets with typed blocks.
  • metadata — MIME, title, author, page count, sheet names.
import { extract } from 'any-extractor';

const result = await extract('./quarterly-report.pdf');

result.markdown; // GFM string
result.text; // plain text
result.sections; // typed blocks
result.metadata; // { mime, title, pageCount, ... }

result.markdown

# Q3 Results

Revenue grew **18%** year-over-year, driven by APAC.

| Region | Revenue |
| ------ | ------- |
| APAC   | $4.2M   |
| EMEA   | $3.1M   |

result.sections

[
  {
    kind: 'page',
    label: 'Page 1',
    index: 1,
    blocks: [
      { id: 'a1b2…', type: 'heading', level: 1, text: 'Q3 Results' },
      {
        id: 'c3d4…',
        type: 'paragraph',
        text: 'Revenue grew **18%** year-over-year, driven by APAC.',
      },
      {
        id: 'e5f6…',
        type: 'table',
        headers: ['Region', 'Revenue'],
        rows: [
          ['APAC', '$4.2M'],
          ['EMEA', '$3.1M'],
        ],
      },
    ],
  },
];

result.metadata

{
  mime: 'application/pdf',
  source: './quarterly-report.pdf',
  title: 'Q3 Results',
  author: 'Finance Team',
  pageCount: 42,
}

Install

npm install any-extractor

Node.js ≥ 18.


MCP Server

any-extractor doubles as a Model Context Protocol server. Drop it into Claude Desktop, Cursor, VS Code, Continue, or any MCP-capable agent.

{
  "mcpServers": {
    "any-extractor": {
      "command": "npx",
      "args": ["-y", "any-extractor-mcp"],
    },
  },
}

| Tool | Use it for | | ----------------------------- | ------------------------------------------------------------- | | extract_document | Default. Markdown + metadata + section index. | | extract_document_structured | Full typed section/block tree — for agents that walk content. | | extract_section | One section by index. Cheap paging for large PDFs. |


Supported formats

| Format | Sections emitted | | ------------ | -------------------------- | | PDF | one page per page | | Word | single body | | Excel | one sheet per worksheet | | PowerPoint | one slide per slide | | OpenDocument | body / sheet / slide | | HTML | single body | | Markdown | single body | | Plain text | single body | | CSV | single body | | JSON | single body |


CLI

# Markdown to stdout (default)
npx any-extractor report.pdf

# Everything else — flags, formats, URLs, stdin, timeouts
npx any-extractor --help

Programmatic API

Cancellation & timeouts

// User-driven cancel
const ac = new AbortController();
await extract('./big.pdf', { signal: ac.signal });

// Hard deadline
await extract(url, { timeoutMs: 10_000 });

// Both — whichever fires first wins
await extract(url, { signal: ac.signal, timeoutMs: 30_000 });

Custom parsers

Register your own MIME handler — e.g. route images through a vision LLM. User parsers override built-ins, and embedded images inside Word / PowerPoint / OpenDocument get enriched automatically.

import { AnyExtractor } from 'any-extractor';

const extractor = new AnyExtractor();

extractor.addParser({
  mimes: ['image/png', 'image/jpeg'],
  concurrency: 2, // rate-limit in-flight calls
  async parse(buffer, ctx) {
    const caption = await myVisionModel(buffer);
    return {
      sections: [{ kind: 'body', blocks: [ctx.block.paragraph(caption)] }],
    };
  },
});

await extractor.extract('./slides.pptx');

Enriched images render with a blockquote caption in the output markdown:

![Sales chart](media/image1.png)

> Bar chart showing Q3 revenue up 18% vs. Q2, driven by APAC.

Support

If any-extractor saved you an afternoon, you can Buy Me a Coffee — it keeps the parsers fed.

License

MIT