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

mreader

v2.0.0

Published

Extract clean Markdown from any URL

Readme

mreader

NPM Downloads NPM Version NPM License Last Commit GitHub Workflow Status

Extract clean Markdown from any URL. Prefers server-side Markdown via content negotiation (Accept: text/markdown, e.g. Cloudflare Docs as Markdown), falls back to client-side extraction with @extractus/article-extractor and Turndown.

Install

npm install -g mreader

CLI

# Print article as Markdown (with YAML frontmatter)
mreader https://example.com/article

# Save to file
mreader https://example.com/article -o article.md

# Output as JSON (title, author, content, excerpt, …)
mreader https://example.com/article -j

# Skip YAML frontmatter
mreader https://example.com/article --no-frontmatter

# Skip content negotiation, always extract from HTML
mreader https://example.com/article --no-content-negotiation

# Read HTML from stdin
curl -s https://example.com/article | mreader - --url https://example.com/article

Options

| Flag | Description | |------|-------------| | -o, --output <file> | Write output to file instead of stdout | | -j, --json | Output as JSON | | --no-frontmatter | Omit YAML frontmatter from output | | --no-content-negotiation | Skip Accept: text/markdown, always extract from HTML | | --url <url> | Base URL for stdin mode | | -h, --help | Show help | | -v, --version | Show version |

Content negotiation

By default mreader sends Accept: text/markdown first. If the server responds with Content-Type: text/markdown, that response is used directly — no extraction or conversion needed. Otherwise mreader falls back to fetching the HTML and extracting the article client-side.

Use --no-content-negotiation (CLI) or noContentNegotiation: true (API) to skip this step.

API

import { read, readFromHtml, formatArticle } from "mreader";

// From URL
const article = await read("https://example.com/article");
console.log(article.title);
console.log(article.content); // clean Markdown

// From HTML string
const article2 = await readFromHtml(html, "https://example.com/article");

// Format with YAML frontmatter
console.log(formatArticle(article));

// Format without frontmatter
console.log(formatArticle(article, false));

read(url, options?)

Fetches the URL and returns an Article object.

Options:

interface ReadOptions {
  headers?: Record<string, string>;
  signal?: AbortSignal;
  noContentNegotiation?: boolean; // skip Accept: text/markdown
}

readFromHtml(html, url)

Parses an HTML string and returns an Article object.

formatArticle(article, frontmatter?)

Returns the article as a Markdown string, optionally prefixed with YAML frontmatter (default: true).

Article

interface Article {
  title: string;
  author: string | null;
  content: string; // Markdown
  excerpt: string | null;
  published: string | null;
  source: string | null;
  url: string;
}

License

MIT

Made with ❤️ by the Roman Ožana