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

hxread

v0.0.10

Published

中文项目国际化时相关的脚本

Readme

安装

npm install hxread -g

使用

读取目标路径下文件内容的中文

hxread [读取文件的路径] [输出的文件名] [支持读取文件的后缀]

对比目标路径下文件内容是否使用路径2导出的国际化对象文件

hxread [读取文件的路径] [国际化文件的路径] [输出的文件名] [支持读取文件的后缀]

目标路径下的文件内容中文转换成香港繁体字

hxread --hk [读取文件的路径] [支持读取文件的后缀]
  • 读取文件的路径,会遍历递归读取路径上的所有文件
  • 输出的文件名,会在执行指令的所在目录下输出生成文件,文件名默认为 output.txt
  • 支持读取文件的后缀,不填会默认读取所有文件,填了则默认只读取支持读取文件的后缀的文件,用逗号分割符隔开,例: html,js ,这样就只会读取html和js文件
  • 国际化文件的路径,国际化一般就是导出一个对象,可为json文件或js文件,js文件需要module.exports导出国际化对象。

读取翻译好的xlsx文件(含中英文),根据翻译后的英文生成变量,输出中文和英文的js对象

hxread --transObj [必填,翻译好的xlsx文件的路径] sheetName [读取所在sheet名称] cnName [必填,中文列名] enName [必填,英文列名] sheetIndex [读取所在sheet下标] only['cn':只输出中文,'en':只输出英文,默认'all']

读取项目中的中文

  • 把项目中的国际化中文给注释掉,例如:
 // import zhCN from "***/项目名.es"
// import zhHK from "***/项目名.es"

这是为了把已做国际化的中文排除,避免被打包进去。

  • 打包构建项目
npm run build
  • 找到输出的dist文件夹,找到里面的js文件夹,然后执行下面的命令,例如:
hxread D:\webapp_vue\dist\child\storage\static\js
  • 最后就会看到一个 output.txt 文件,里面就是被抽取的中文。