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

@markdown-for-agents/audit

v1.2.4

Published

Audit token savings when converting HTML to Markdown for AI agents

Readme

@markdown-for-agents/audit

npm version npm downloads types license

Audit token savings when converting HTML to Markdown with markdown-for-agents — a runtime-agnostic HTML to Markdown converter built for AI agents.

markdown-for-agents

Audit any URL — no installation required:

npx @markdown-for-agents/audit https://docs.github.com/en/copilot/get-started/quickstart
           HTML            Markdown        Savings
───────────────────────────────────────────────────
Tokens     138,550         9,364           -93.2%
Chars      554,200         37,456          -93.2%
Words      27,123          4,044
Size       541.3 KB        36.6 KB         -93.2%

Fetch any URL, convert the HTML to Markdown, and see exactly how many bytes and tokens you save. Useful for evaluating the impact of serving Markdown to AI agents instead of raw HTML.

Quick Start

No installation required — run directly with npx:

npx @markdown-for-agents/audit https://example.com
           HTML            Markdown        Savings
───────────────────────────────────────────────────
Tokens     48,291          12,073          -75.0%
Chars      193,164         48,292          -75.0%
Words      9,456           5,209
Size       188.6 KB        47.2 KB         -75.0%

Options

npx @markdown-for-agents/audit <url> [options]

  --no-extract    Skip content extraction
  --json          Output as JSON
  --print         Print converted Markdown to terminal
  --output <file> Save converted Markdown to file
  -h, --help      Show help

Programmatic API

import { audit } from '@markdown-for-agents/audit';

const result = await audit('https://example.com', { extract: true });

console.log(result.reduction.tokenPercent); // e.g. 82.6
console.log(result.markdown.content); // converted markdown

Result shape

{
    url: string;
    html: {
        bytes: number;
        tokens: TokenEstimate;
    }
    markdown: {
        content: string;
        bytes: number;
        tokens: TokenEstimate;
    }
    reduction: {
        bytes: number;
        bytePercent: number;
        tokens: number;
        tokenPercent: number;
    }
}

Options

Accepts all markdown-for-agents options, plus:

  • fetchOptions — passed directly to fetch() for custom headers, auth, etc.

Related packages

| Package | Description | | -------------------------------------------------------------------------------------------- | ------------------------------- | | markdown-for-agents | Core HTML-to-Markdown converter | | @markdown-for-agents/express | Express middleware | | @markdown-for-agents/fastify | Fastify plugin | | @markdown-for-agents/hono | Hono middleware | | @markdown-for-agents/nextjs | Next.js middleware | | @markdown-for-agents/web | Web Standard middleware |

License

MIT