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

@ykn/xxhhss

v1.0.7

Published

基于 Bun 的 XHS 下载核心逻辑 TypeScript 迁移(不是 Node),当前优先关注解析与抽取。

Readme

xhs_ts

基于 Bun 的 XHS 下载核心逻辑 TypeScript 迁移(不是 Node),当前优先关注解析与抽取。

结构

  • src/url.ts:URL 解析、短链解析、笔记 ID 提取
  • src/html.ts:HTML/JS 解析(window.__INITIAL_STATE__
  • src/media.ts:媒体抽取与 URL 规范化
  • src/cdn.ts:CDN URL 转换
  • src/fetch.ts:网络请求封装
  • src/download.ts:下载工具(Bun/Node)
  • src/orchestrator.ts:解析与抽取的编排入口
  • test/:单元测试(Bun)

使用(Bun)

  • 运行测试:bun test
  • 类型检查:bun run typecheck

MCP 使用(stdio)

  • 构建(生成 Node 可运行的 MCP 入口):bun run build:mcp
  • 运行:node dist-mcp/node/index.js
  • 发送请求(JSON-RPC 单行):{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26"}}

MCP 客户端配置(npx 方式)

# [mcp_servers.omni-eye]
# command = "npx"
# args = ["@ykn/xxhhss"]

API 示例

解析链接并返回媒体元信息

import { parseFromHtmlUrl } from "./src/api/parse";

const result = await parseFromHtmlUrl("https://xhslink.com/xxxx");
console.log(result.title);
console.log(result.media);

Demo

  • 解析 URL 元信息:bun run demo/parse_from_url.ts <url>

输入类型

  • URL 文本输入:解析并规范化xhs链接
  • HTML 输入:解析 window.__INITIAL_STATE__ 获取笔记数据

下一步:媒体抽取、CDN 转换、下载管线、Live Photo 处理。

强制要求:必须用中文思考和输出。