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

claude-plugin-gbk

v1.1.0

Published

Claude Code 插件:GBK/UTF-8 编码自动切换。开启后 .txt/.ini/.cfg 文件读写自动在 GBK ↔ UTF-8 间转换,适用于传奇私服等 GBK 编码脚本项目。

Readme

claude-plugin-gbk

Claude Code 插件:GBK/UTF-8 编码自动切换。开启后 .txt .ini .cfg 文件读写自动在 GBK ↔ UTF-8 间转换,无需手动干预。

适用于传奇私服(Legend of Mir 2)等 GBK/GB2312 编码的脚本项目。

安装

npm install -g claude-plugin-gbk

安装后 postinstall 脚本自动将插件复制到 ~/.claude/plugins/claude-plugin-gbk

然后在 ~/.claude/settings.json 中添加 marketplace 和插件配置:

{
  "extraKnownMarketplaces": {
    "gbk-tools": {
      "source": {
        "source": "directory",
        "path": ".claude/plugins/claude-plugin-gbk"
      }
    }
  },
  "enabledPlugins": {
    "claude-plugin-gbk@gbk-tools": true
  }
}

重启 Claude Code 或执行 /hooks 刷新配置即可生效。

卸载

npm uninstall -g claude-plugin-gbk
rm -rf ~/.claude/plugins/claude-plugin-gbk

然后从 ~/.claude/settings.json 中删除 gbk-tools 的 marketplace 配置和 claude-plugin-gbk 的插件配置。

功能

| 功能 | 说明 | |------|------| | 自动编码转换 | Read 前 GBK→UTF-8,Write/Edit 后 UTF-8→GBK | | 编码开关 | /encoding gbk 开启,/encoding utf8 关闭 | | 批量转换 | /gbk-convert to-utf8\|to-gbk\|detect 手动转换 | | 零干扰 | 文件已是目标编码时跳过,不改变 mtime |

使用

/encoding gbk                    开启 GBK 模式
/encoding utf8                   关闭 GBK 模式
/encoding                        查看当前模式

/gbk-convert detect  ./          检测编码
/gbk-convert to-utf8 文件/目录    GBK → UTF-8
/gbk-convert to-gbk  文件/目录    UTF-8 → GBK

日常流程:

/encoding gbk                 ← 一次性开启
正常读写 QFunction-0.txt      ← 编码自动处理

工作原理

GBK 模式开启后(项目存在 .claude/gbk-mode 文件),hooks 自动拦截文件操作:

Read:   文件(GBK) → PreToolUse → UTF-8 → Claude 读取显示
Write:  Claude 写入(UTF-8) → PostToolUse → 文件(GBK)
Edit:   PreToolUse(GBK→UTF-8) → 编辑 → PostToolUse(UTF-8→GBK)

| Hook | 触发工具 | 行为 | |------|----------|------| | PreToolUse | Read, Write, Edit | GBK → UTF-8(已是 UTF-8 则跳过) | | PostToolUse | Write, Edit | UTF-8 → GBK(已是 GBK 则跳过) |

依赖

许可

MIT