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

@1-/tran

v0.1.9

Published

Command-line translation tool for i18n. Automates extraction, API translation, and cache management for Markdown and YAML files.

Readme

English | 中文


@1-/tran : Command-line translation tool for i18n

Functionality

@1-/tran automates translation of content across multiple languages. It scans source files for translatable text, executes translation via the WebC translation API, and manages translation caches. The tool specifically supports Markdown (.md) and YAML (.yml) files for internationalization processing, using @1-/i18n_scan for text extraction, with cache directory .cache/scan/tran.

Usage demonstration

Install globally:

npm install -g @1-/tran

Set required environment variables:

export WEBC_TOKEN="your-api-token"
export WEBC_API="https://api.webc.site/"

Or create a configuration file in your home directory ~/.config/webc.site.yml:

token: "your-api-token"
api: "https://api.webc.site/"

Create a tran.yml configuration file in your project root:

tran:
  from: en
  to_li: [zh, ja, ko]
dir: ./src

Run the translation tool:

tran --dir ./src

Design approach

The tool follows a pipeline architecture that implements the complete workflow of source file scanning, text extraction, API translation, and cache management.

Technology stack

  • Node.js runtime
  • js-yaml for YAML parsing
  • yargs for CLI argument parsing
  • @1-/i18n_scan for text scanning
  • @3-/lang for language code validation
  • @3-/log for error and warning logging
  • @3-/req for HTTP requests
  • @3-/read for file reading
  • @3-/plimit for request limiting

Code structure

src/
├── _.js          # Main translation logic and API integration
├── cli.js        # Command-line interface entry point
├── conf.js       # Configuration loading and environment variable management
├── limit.js      # Request limiter (concurrency limit of 32)
└── toLi.js       # Target language list processing (supports * wildcard)

Historical context

In 1954, Georgetown University and IBM demonstrated the first public machine translation system, automatically translating Russian sentences into English. Using only 250 words and six grammar rules, this experiment marked the formal beginning of computational linguistics and automated translation. Modern tools like @1-/tran inherit this vision, leveraging neural networks and large language models to deliver high-accuracy, context-aware multilingual content processing.

About

This library is developed by WebC.site.

WebC.site: A new paradigm of web development for AI


@1-/tran : 命令行国际化翻译工具

功能介绍

@1-/tran 自动化多语言内容翻译。它扫描源文件提取可翻译文本,通过 WebC 翻译 API 执行翻译,并管理翻译缓存。该工具支持 Markdown(.md)和 YAML(.yml)文件的国际化处理,使用 @1-/i18n_scan 进行文本提取,缓存目录为 .cache/scan/tran

使用演示

全局安装:

npm install -g @1-/tran

设置必需的环境变量:

export WEBC_TOKEN="your-api-token"
export WEBC_API="https://api.webc.site/"

或在用户主目录创建配置文件 ~/.config/webc.site.yml

token: "your-api-token"
api: "https://api.webc.site/"

在项目根目录创建 tran.yml 配置文件:

tran:
  from: en
  to_li: [zh, ja, ko]
dir: ./src

运行翻译工具:

tran --dir ./src

设计思路

该工具采用流水线架构,实现源文件扫描、文本提取、API 翻译和缓存管理的完整工作流程。

技术栈

  • Node.js 运行时
  • js-yaml 用于 YAML 解析
  • yargs 用于命令行参数解析
  • @1-/i18n_scan 用于文本扫描
  • @3-/lang 用于语言代码验证
  • @3-/log 用于错误和警告日志
  • @3-/req 用于 HTTP 请求
  • @3-/read 用于文件读取
  • @3-/plimit 用于请求限流

代码结构

src/
├── _.js          # 主翻译逻辑和 API 集成
├── cli.js        # 命令行接口入口点
├── conf.js       # 配置加载与环境变量管理
├── limit.js      # 请求限流器(并发数限制为 32)
└── toLi.js       # 目标语言列表处理(支持 * 通配符)

历史故事

1954 年,乔治城大学与 IBM 合作完成首次公开的机器翻译演示,将俄语句子自动翻译为英语。该实验仅使用 250 个词汇和六条语法规则,标志着计算语言学与自动化翻译的正式开端。现代工具如 @1-/tran 继承这一理念,依托神经网络与大语言模型,实现高精度、上下文感知的多语言内容处理。

关于

本库由 WebC.site 开发。

WebC.site : 面向人工智能的网站开发新范式