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

web-crawler-ai

v0.0.5

Published

一个用于爬取产品需求文档并转换为Markdown格式的AI+Node.js工具

Downloads

1

Readme

产品需求文档网页转换工具

产品需求文档网页转换工具

这是一个将产品需求文档网页转换为 Markdown 格式的工具。它使用爬虫技术抓取网页内容,并将其转换为易于阅读和编辑的 Markdown 文件。

特性

  • 支持自定义配置文件
  • 可设置爬取深度和并发数量
  • 支持最大重试次数
  • 自动下载网页中的图片并保存为本地文件
  • 生成的 Markdown 文件结构清晰
  • 支持登录认证以访问受保护的文档
  • 使用 AI 处理和优化文档内容
  • 支持子页面截图和内容整合

安装

请确保您已安装 Node.js 和 npm。然后,您可以通过以下命令安装依赖:

npm install

配置

在使用工具前,您需要创建一个配置文件。您可以复制 doc-crawler.config.example.js 并根据需要进行修改:

cp doc-crawler.config.example.js doc-crawler.config.js

配置文件包含以下主要部分:

  • 爬虫设置(深度、并发数、超时等)
  • 浏览器配置
  • 输出目录设置
  • 认证信息(如需访问受保护内容)
  • AI 处理参数(如使用 OpenAI 优化内容)

使用方法

node bin/doc-crawler.mjs <url> [options]

参数

  • : 需要爬取的网页 URL(必需)

选项

  • -c, --config : 配置文件路径(默认: ./doc-crawler.config.js)
  • -o, --output : 输出目录路径
  • -d, --depth : 链接爬取深度
  • --maxRetries : 最大重试次数
  • --concurrency : 并发数量
  • -v, --version: 显示版本号
  • -h, --help: 显示帮助信息

示例

# 使用默认配置爬取文档

** crawler https://example.com/product-doc**

# 指定配置文件和输出目录

crawlernode ** https://example.com/product-doc** -c ./my-config.js -o ./output

# 设置爬取深度和并发数

crawler https://example.com/product-doc -d 2 --concurrency 5

工作原理

  • 工具首先爬取指定的主页面内容
  • 如果配置了认证信息,会先进行登录获取 cookies
  • 根据设置的深度爬取相关子页面
  • 下载页面中的图片并保存到本地
  • 使用 AI 处理和优化内容(如已配置)
  • 生成结构化的 Markdown 文件

许可证

MIT

这是一个将产品需求文档网页转换为 Markdown 格式的工具。它使用爬虫技术抓取网页内容,并将其转换为易于阅读和编辑的 Markdown 文件。

特性

  • 支持自定义配置文件
  • 可设置爬取深度和并发数量
  • 支持最大重试次数
  • 自动下载网页中的图片并保存为本地文件
  • 生成的 Markdown 文件结构清晰

安装

请确保您已安装 Node.js 和 npm。然后,您可以通过以下命令安装依赖:


```