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

webmd-cli

v1.0.0

Published

Convert web pages to Markdown files. Supports single page conversion and full site crawling via sitemap.xml

Readme

webmd-cli

English | 日本語


English

Convert web pages to Markdown files with preserved structure.

Features

  • 🚀 Single page conversion
  • 📦 Full site crawling via sitemap.xml
  • 🔗 Converts relative URLs to absolute URLs
  • 📁 Preserves directory structure (optional)
  • 🎯 Maintains HTML structure in Markdown (h1 → #, h2 → ##, etc.)

Installation

npx webmd <URL>

Or install globally:

npm install -g webmd-cli

Usage

Single Page Conversion

Convert a single web page to Markdown:

npx webmd https://example.com/page

Output: example-com/page.md

Full Site Crawling

Crawl entire site using sitemap.xml:

npx webmd -f https://example.com

This will:

  1. Fetch https://example.com/sitemap.xml
  2. Download all pages listed in the sitemap
  3. Save them to example-com/ directory

Preserve Directory Structure

Use the -d flag to maintain the original URL structure:

npx webmd -f -d https://example.com
  • Without -d: example-com/about-team.md
  • With -d: example-com/about/team.md

Examples

# Single page
npx webmd https://example.com/

# Full site (flat structure)
npx webmd -f https://example.com/

# Full site (preserve directory structure)
npx webmd -f -d https://example.com/

Output

  • Images: ![alt](https://example.com/image.png)
  • Links: [text](https://example.com/link)
  • All relative URLs are converted to absolute URLs

Requirements

  • Node.js 14 or higher
  • Site must have sitemap.xml for full site crawling

License

MIT


日本語

WebページをMarkdownファイルに変換するCLIツール。HTML構造を維持したまま変換します。

機能

  • 🚀 単一ページの変換
  • 📦 sitemap.xmlを使ったサイト全体のクロール
  • 🔗 相対URLを絶対URLに自動変換
  • 📁 ディレクトリ構造の保持(オプション)
  • 🎯 HTML構造をMarkdownで維持(h1 → #、h2 → ##など)

インストール

npx webmd <URL>

グローバルインストールする場合:

npm install -g webmd-cli

使い方

単一ページの変換

1つのWebページをMarkdownに変換:

npx webmd https://example.com/page

出力: example-com/page.md

サイト全体のクロール

sitemap.xmlを使ってサイト全体をクロール:

npx webmd -f https://example.com

以下の処理を実行します:

  1. https://example.com/sitemap.xml を取得
  2. sitemapに記載された全ページをダウンロード
  3. example-com/ ディレクトリに保存

ディレクトリ構造の保持

-d フラグを使うと、元のURL構造を維持します:

npx webmd -f -d https://example.com
  • -d なし: example-com/about-team.md
  • -d あり: example-com/about/team.md

使用例

# 単一ページ
npx webmd https://example.com/

# サイト全体(フラット構造)
npx webmd -f https://example.com/

# サイト全体(ディレクトリ構造を保持)
npx webmd -f -d https://example.com/

出力形式

  • 画像: ![alt](https://example.com/image.png)
  • リンク: [text](https://example.com/link)
  • すべての相対URLは絶対URLに変換されます

必要環境

  • Node.js 14以上
  • サイト全体のクロールにはsitemap.xmlが必要

ライセンス

MIT