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

translate-server

v0.0.1

Published

A tool for transforming and translating locale files

Readme

多语言本地化翻译工具

这是一个基于大语言模型的本地化翻译工具,可以自动处理并翻译各种本地化文件(.ts、.js、.json)中的文本内容。

功能特点

  1. 支持多种文件格式

    • TypeScript (.ts)
    • JavaScript (.js)
    • JSON (.json)
  2. 智能文件处理

    • 自动识别文件中的语言代码(如:en-US, zh-CN)
    • 自动备份原始文件
    • 保持源文件格式和结构
  3. 高效批处理

    • 支持整个目录的批量处理
    • 自动创建输出目录结构
    • 并发处理多个文件
    • 支持单文件处理
  4. 安全特性

    • 自动文件备份
    • 错误处理和日志记录
    • 格式验证和清理

使用说明

文件命名规范

翻译文件需要在文件名中包含语言代码,例如:

  • messages.en-US.ts
  • translations.zh-CN.json

支持的语言代码格式:

  • xx-XX(如:zh-CN, en-US)
  • xx-xx(如:zh-cn, en-us)

Cursor 配置说明

  1. 打开 Cursor 设置
  2. 找到 MCP 配置
  3. 根据操作系统输入对应配置:

Mac 用户

{
  "mcpServers": {
    "transform": {
      "command": "node",
      "args": [
        "{\"apiKey\":\"你的API密钥\",\"modelName\":\"你使用的模型名称\",\"baseUrl\":\"API基础URL\"}"
      ]
    }
  }
}

Windows 用户

{
  "mcpServers": {
    "transform": {
      "command": "cmd",
      "args": [
        "/c",
        "node",
        "{\"apiKey\":\"你的API密钥\",\"modelName\":\"你使用的模型名称\",\"baseUrl\":\"API基础URL\"}"
      ]
    }
  }
}

注意事项

  1. 文件处理

    • 处理前会自动备份原文件
    • 备份文件格式:原文件名.backup.时间戳.扩展名
    • 跳过不符合命名规范的文件
  2. 错误处理

    • 单个文件处理失败不会影响其他文件
    • 控制台会输出处理状态和错误信息
  3. 性能优化

    • 大文件会自动分块处理
    • 默认每块最大处理 500 个键值对
    • 并发处理多个文件提高效率
  4. 路径问题

    • 请使用绝对路径,相对路径会查找代码执行位置