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

tinyi18n-cli

v0.0.1-beta.2

Published

A lightweight, out-of-the-box frontend i18n management tool and development suite.

Readme

TinyI18n cli

tinyi18n-cli 是一个轻量级、开箱即用的前端国际化 (i18n) 管理工具和开发套件。它提供了一个基于 Web 的 Studio UI 界面,帮助你在本地更高效地管理多语言词条,并能自动与代码库中的 JSON/JS 文件进行双向同步。

📦 安装

推荐作为项目的开发依赖进行安装:

# npm
npm install tinyi18n-cli -D

# yarn
yarn add tinyi18n-cli -D

# pnpm
pnpm add tinyi18n-cli -D

当然,你也可以全局安装直接使用,或者通过 npx 直接运行:

npx tinyi18n

🚀 快速开始

在你的前端项目根目录中,直接运行 tinyi18n 即可启动服务:

npx tinyi18n
  • 如果这是你第一次在这个项目中使用 tinyi18n,它会自动引导你完成初始化配置,并在浏览器中打开配置页面。
  • 如果已经配置过,它会启动本地的 Studio 服务,并打开浏览器让你管理多语言词条。
  • 需要将词条生成到源码时,可以运行 npx tinyi18n generate,也可以使用短命令 npx tinyi18n g

⚙️ 配置说明

初始化完成后,会在你的项目根目录的 .tinyi18n 文件夹下生成一个 config.ts 配置文件。一个典型的配置如下:

import { defineConfig } from 'tinyi18n-cli'

export default defineConfig({
  // 默认语言(如果设置,Studio 在展示翻译时会优先显示此语言)
  defaultLocale: 'zh-CN',
  // 你需要维护的语言列表
  locales: [
    { code: 'zh-CN', filename: 'zh.json' },
    { code: 'en-US', filename: 'en.json' },
  ],
  // 如果需要同步 JSON 数据到代码文件,可以配置 entries
  entries: [
    {
      // 生成的源码目录
      dir: './src/i18n',
      // 你希望导出到这个目录的路径过滤规则。
      // 可以是空数组(导出所有词条),也可以指定如 "pages.home", "components.*" 等层级路径。
      paths: [],
    },
  ],
})

✨ 核心特性

  • Web Studio: 内置现代化且功能丰富的 Web UI 界面,提供树状图/表格视图来编辑词条。
  • 配置即代码: 采用 .tinyi18n/config.ts 进行配置,支持 TypeScript 类型提示。
  • 多入口同步: 除了生成纯 JSON 文件外,还能配置生成 JS/TS 文件,方便在前端源码中直接导入使用。
  • 自动检测与无缝接入: 无需复杂的配置即可跑起来,对现有基于 JSON 存储的多语言项目有极好的兼容性。

📄 许可证

MIT License