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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@xiaowaibuzheng/rname

v0.0.9

Published

A CLI tool for batch renaming files with Chinese characters to pinyin or English translation

Readme

@xiaowaibuzheng/rname

NPM version

一个用于批量重命名包含中文字符的文件的命令行工具,可以将中文文件名翻译为英文并转换为驼峰命名格式。

功能特点

  • 将包含中文的文件名翻译为英文并转换为驼峰命名格式
  • 支持跳过已存在的文件名以避免冲突
  • 支持通过 Bing 翻译 API 进行高质量翻译
  • 自动移除高清图片的 @2x 后缀
  • 可通过 npx 直接运行,无需全局安装

安装

使用 npx 直接运行(推荐)

npx @xiaowaibuzheng/rname [directory]

作为 CLI 工具全局安装

npm install -g @xiaowaibuzheng/rname
rname [directory]

使用方法

基本用法

# 将当前目录下的中文文件名翻译为英文
npx @xiaowaibuzheng/rname

# 指定特定目录
npx @xiaowaibuzheng/rname ./images

参数说明

| 参数 | 说明 | 默认值 | | ------------- | ---------------- | --------------- | | [directory] | 要处理的目录路径 | 当前目录 (./) |

示例

假设目录中有以下文件:

./我的图片.png
./测试文档.docx
./产品介绍@2x.jpg

执行命令:

npx @xiaowaibuzheng/rname

结果可能是:

🟢 开始处理目录: /path/to/current/directory
🔄 使用模式: ENGLISH
✅ ENGLISH: 我的图片.png                → myPicture.png
✅ ENGLISH: 测试文档.docx              → testDocument.docx
✅ ENGLISH: 产品介绍@2x.jpg            → productIntroduction.jpg
✅ 所有文件处理完成

注意事项

  1. 由于调用 Bing 翻译 API,会有一定延迟
  2. 工具只会处理包含中文字符的文件名
  3. 对于带有 @2x 后缀的文件(通常为高清图片),会去除该后缀再进行转换
  4. 需要 Node.js 版本 >=20

依赖说明

许可证

MIT