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

botrun-crawler-2

v1.0.0

Published

智慧網頁爬蟲 - 支援動態下載連結偵測、MIME type 分析、政府網站相容

Readme

botrun-crawler

智慧網頁爬蟲 - 支援動態下載連結偵測、MIME type 分析、政府網站相容

安裝

npm install -g botrun-crawler

CLI 使用方法

基本爬取

# 單頁完整爬取
botrun-crawler crawl "https://example.com"

# JSON 格式輸出
botrun-crawler crawl "https://example.com" --json

# 安靜模式
botrun-crawler crawl "https://example.com" -q

儲存結果

# 儲存 HTML
botrun-crawler crawl "https://example.com" --save-html page.html

# 儲存純文字(LLM 友善格式)
botrun-crawler crawl "https://example.com" --save-text page.txt

# 儲存下載連結清單
botrun-crawler crawl "https://example.com" --save-downloads urls.txt

# 全部儲存
botrun-crawler crawl "https://example.com" \
  --save-html page.html \
  --save-text page.txt \
  --save-downloads urls.txt

效能選項

# 跳過 MIME type 分析(加快速度)
botrun-crawler crawl "https://example.com" --skip-mime

命令總覽

| 命令 | 說明 | |------|------| | crawl <url> | 單頁完整爬取(推薦) | | scrape <url> | 簡易版抓取 | | scrape-batch <file> | 批次抓取多個網址 | | process <file> | 處理本地檔案 | | help | 顯示說明 |

crawl 選項

| 選項 | 說明 | |------|------| | --json | JSON 格式輸出 | | --save-html <file> | 儲存原始 HTML | | --save-text <file> | 儲存純文字 | | --save-downloads <file> | 儲存下載連結清單 | | --skip-mime | 跳過 MIME type 分析 | | -v, --verbose | 詳細模式 | | -q, --quiet | 安靜模式 |

輸出範例

========================================
 單頁完整爬取結果
========================================
網址: https://www.ida.gov.tw/...
標題: 經濟部產業發展署

連結統計
├─ 下載連結: 475 個
│   ├─ PDF: 120
│   ├─ Word: 85
│   └─ 動態連結: 270
├─ 連外連結: 22 個
└─ 內部連結: 675 個

Proxy 設定

export HTTPS_PROXY="http://proxy:8080"
export HTTP_PROXY="http://proxy:8080"
export NO_PROXY="localhost,.internal.com"

程式庫使用

import { crawlPage } from 'botrun-crawler/crawler';

const result = await crawlPage('https://example.com');
console.log(result.links.downloads.count);

子模組

import { PageCrawler, crawlPage } from 'botrun-crawler/crawler';
import { scrapeUrl } from 'botrun-crawler/scraper';
import { fetchWithProxy, fetchMimeType } from 'botrun-crawler/lib';

特色

  • 動態下載連結偵測:自動識別 download.aspxgetFile.do 等動態連結
  • MIME Type 分析:自動分類 PDF/Word/Excel 等檔案類型
  • 檔名亂碼修正:自動修正 UTF-8 編碼問題
  • 政府網站相容:針對台灣政府網站最佳化

License

MIT