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

webforai

v3.0.0

Published

A library that provides a web interface for AI

Readme

Documentation

Head to the documentation to read and learn more about Webforai.

Overview

# URL or local HTML file → Markdown on stdout (add -o out.md to write a file)
npx webforai@latest https://example.com/article

# machine-readable output, hosted-platform fetching, agent installation
npx webforai@latest https://example.com --json
npx webforai@latest https://example.com --engine browser   # platform, renders JS
npx webforai@latest skill --install                        # Agent Skill via `npx skills add`

or

import { htmlToMarkdown, htmlToMdast } from "webforai";
import { loadHtml } from "webforai/loaders/playwright";

// Load html from url
const url = "https://www.npmjs.com/package/webforai";
const html = await loadHtml(url);

// Convert html to markdown
const markdown = htmlToMarkdown(html, { baseUrl: url });

What v3 changes

Better extraction. The main-content extractor scores candidate containers the way Readability does — paragraph density, link density, class weighting, ancestor propagation — and adds signals the 2010 heuristics predate: semantic markup (<article>, <main>, role="main", schema.org articleBody), the rendered geometry a browser loader can supply, and CJK-aware length thresholds. Across a 60-page corpus of real sites, the share of output lines that were bare links — the clearest sign navigation leaked in — dropped from 10.6% to 5.0%.

Site adapters. Pages that generic scoring cannot read are handled directly, matched by hostname or by a platform fingerprint so self-hosted instances are covered too: GitHub, Stack Overflow, npm, MDN, Zenn, Qiita, Medium, Substack, note, Hatena, WordPress, Wikipedia, Reddit, YouTube, Hacker News, Docusaurus, VitePress, MkDocs, Read the Docs and GitBook. An adapter that produces too little is ignored in favour of generic extraction, so a site redesign degrades rather than breaks.

// Pass adapters: false for generic extraction only.
import { createAutoExtractor } from "webforai";

const markdown = htmlToMarkdown(html, {
  url,
  extractors: [createAutoExtractor({ adapters: false })],
});

Page metadata.

import { htmlToMarkdownWithMetadata } from "webforai";

const { markdown, metadata } = htmlToMarkdownWithMetadata(html, { url });
// metadata: { title, author, published, siteName, canonicalUrl, lang, ... }

// Or prepend it as YAML front matter:
const withFrontmatter = htmlToMarkdown(html, { url, frontmatter: true });

Markup fixes. Lazily-loaded images (data-src, srcset) now resolve to a real URL instead of ![alt](); KaTeX and MathJax expressions are no longer emitted twice; role="heading" elements become real headings; superscripts and subscripts stay distinguishable; and definition lists keep their term/definition pairing.

See the changeset for the full list, including the breaking changes.

Platform (hosted API)

apps/platform is an OSS, self-hostable SaaS built on this library: a metered crawl→Markdown HTTP API on Cloudflare (Workers + Workflows + Containers + Browser Run) with Better Auth accounts/API keys and Stripe usage-based billing. Use it through the typed webforai/platform client (import { createPlatformClient } from "webforai/platform") or the CLI (npx webforai <url> --engine browser); docs live at webforai.dev/platform. See its README and the design ledger in docs/specs/platform.

Support

License

Apache 2.0 License