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

extojs

v1.0.1

Published

`extojs` 是一个实用的 Node.js 命令行工具,旨在将包含多语言翻译的 Excel 文件 (`.xlsx`, `.xls`) 快速且便捷地转换为 JavaScript i18n 语言包文件。

Readme

extojs (Excel to JS)

extojs 是一个实用的 Node.js 命令行工具,旨在将包含多语言翻译的 Excel 文件 (.xlsx, .xls) 快速且便捷地转换为 JavaScript i18n 语言包文件。

借助 tinyfiledialogs-node,该工具在运行时能提供友好的原生系统文件选择/文件夹选择弹窗,让你完全免除了由于手动复制粘贴过长文件路径所带来的烦恼。

✨ 特性

  • 系统级 UI 弹窗: 自动弹出系统原生的文件选择器和目录选择器,轻松选取输入源和输出目录。
  • 灵活配置: 既能开箱即用,也支持通过命令行参数快捷自定义来源语言主键和目标输出语言。
  • 现代化直接可用: 导出文件为标准的 ES Module 格式(export default { ... }),与现代前端框架完美契合,可被项目直接引用。
  • 多工作表支持: 自动读取及遍历 Excel 文件内部的全部工作表 (Sheet)。

📦 安装流程

运行本工具需要环境内已安装 Node.js

你可以将代码仓库克隆到本地并进行构建:

# 进入目录
cd exceltojs

# 安装依赖 (推荐使用 pnpm)
pnpm install

# 本地打包构建
pnpm run build

# (可选) 将本地构建的命令行工具链接到全局,方便在任何目录执行
npm link

(如果 package.json 中的命令名称已注册在全球环境变量中,你即可在任何终端直接输入 extojs 来使用该工具。)

🚀 使用方法

在终端或命令行直接调用:

extojs

交互流程

  1. 选择文件:运行命令后,首先会弹出一个文件选择对话框,请选中需要转换或解析的 Excel 翻译文件。
  2. 选择目录:随后立即弹出一个文件夹选择对话框,让你指定转换后 JS 文件的存放位置。
  3. 完成输出:工具会读取 Excel 数据并分析,然后将对应的翻译包(如 pt.jses.js 等)顺利输出到刚才指定的那个目录中。

⚙️ 命令行进阶选项

如果你的 Excel 表头(列名)与默认设置不符,可以使用扩展参数来指定:

extojs [options]

| 参数 | 短拼 | 描述 | 默认值 | 示例 | | --- | --- | --- | --- | --- | | --origin [language] | -o | 指定 Excel 里的”源语言“列(该列的值作为对象的 key 键) | 中文 | -o 英语 | | --target [lang1,lang2] | -t | 指定要导出的目标语言列表(多个需用英文逗号 , 隔开)| pt,es | -t fr,de,it | | --help | -h | 显示命令的帮助信息 | - | - |

使用示例: 假设你的 Excel 中,源文本在列名 English 这一列下,你希望提取出 FrenchGerman 两列的数据,你可以这样执行:

extojs -o English -t French,German

📄 Excel 格式要求

第一行必须被设维表头字段(列名)。 需要有明确的源语言列(作为 Key 值),和对应的一个或多个需要导出的目标语言列(作为 Value 值)。

规范例子

| 中文 (默认作为 origin) | pt | es | 备注/无关列 (会被忽略) | | --- | --- | --- | --- | | 登录 | Entrar | Iniciar sesión | 登录按钮翻译 | | 注册 | Registro | Registro | | | 密码 | Senha | Contraseña | |

经过上方 Excel 生成后的 pt.js 输出样例:

export default {
  "登录": "Entrar",
  "注册": "Registro",
  "密码": "Senha"
}

📜 许可证

ISC