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

@rongyan/x-tweet-translator

v0.1.3

Published

Install the x-tweet-translator skill for Codex, Claude Code, and OpenCode.

Readme

X推文翻译器

自动翻译 X(Twitter) 推文采集数据中的非中文内容。JSON 文件建议通过 extract -> check -> apply 的方式安全写回,避免破坏结构。

安装

使用 npx 安装到指定 AGENT:

npx @rongyan/x-tweet-translator install --target codex
npx @rongyan/x-tweet-translator install --target claude-code
npx @rongyan/x-tweet-translator install --target opencode

也支持直接省略 install

npx @rongyan/x-tweet-translator --target codex

默认安装位置:

  • codex${CODEX_HOME:-~/.codex}/skills/x-tweet-translator
  • claude-code~/.claude/skills/x-tweet-translator
  • opencode~/.config/opencode/skills/x-tweet-translator

需要覆盖已有安装时,可加 --force

npx @rongyan/x-tweet-translator install --target claude-code --force

如果只想预览写入位置,可加 --dry-run

npx @rongyan/x-tweet-translator install --target opencode --dry-run

功能特点

  • 支持 JSON 和 Markdown 两种格式
  • 大模型直接翻译,无需外部 API 或脚本
  • 自动检测中文内容,跳过已有中文的字段
  • 支持外链文章的递归翻译
  • 自动跳过 URL 链接,保留 @用户名、#标签、emoji
  • 原始文件不变,翻译结果写入 -cn 后缀的新文件

使用方法

直接告诉 Claude/opencode 需要翻译的文件或目录:

请翻译 /path/to/tweets.json
请翻译 /path/to/tweets/ 目录下所有的 JSON 文件
翻译 /path/to/x-collection-2026-04-25.md

如果是手动运行 JSON 脚本,推荐顺序是:

node <skill-dir>/scripts/translate-json.js extract /path/to/input.json /tmp/plan.json
# 字段多时用 pending / fill 分批填入 translation
node <skill-dir>/scripts/translate-json.js pending /tmp/plan.json 8 > /tmp/pending.json
node <skill-dir>/scripts/translate-json.js fill /tmp/plan.json /tmp/translations.json
node <skill-dir>/scripts/translate-json.js check /path/to/input.json /tmp/plan.json
node <skill-dir>/scripts/translate-json.js apply /path/to/input.json /tmp/plan.json

常见 skill-dir

  • Codex:${CODEX_HOME:-~/.codex}/skills/x-tweet-translator
  • Claude Code:~/.claude/skills/x-tweet-translator
  • OpenCode:~/.config/opencode/skills/x-tweet-translator

输出规则

| 原文件 | 翻译输出 | |--------|----------| | 2026-04-25-01.json | 2026-04-25-01-cn.json | | 2026-04-25-01.md | 2026-04-25-01-cn.md | | articles-data/article.json | articles-data/article-cn.json | | articles/article.md | articles/article-cn.md |

翻译字段

JSON 文件

  • tweets[].text
  • tweets[].article.title
  • tweets[].article.previewText
  • 外链文章:titlepreviewTextplainTextcontentState.blocks[].text

Markdown 文件

  • 非中文的正文段落
  • 外链文章文件中的非中文段落

翻译规则

  • 已含中文的字段 → 跳过
  • 纯 URL → 跳过
  • @用户名、#标签、数字、emoji → 保留原样
  • Markdown 结构、链接 → 保留原样