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

node-translator-os

v1.0.3

Published

JSON and Markdown translator for multiple locales

Readme

node-translator-os

CLI for translating JSON and Markdown files into multiple locales. Install as a devDependency.

Installation

npm install -D node-translator-os

Quick start in a consumer project

{
  "devDependencies": {
    "node-translator-os": "^1.0.3"
  },
  "scripts": {
    "i18n": "node-translator translate --dir i18n/locales --all --exclude ru",
    "i18n:md": "node-translator translate-md --dir blog/translates --all --exclude ru",
    "i18n:status": "node-translator status --dir i18n/locales"
  }
}

Project layout:

my-app/
├── i18n/locales/
│   ├── en.json              # source
│   ├── ru.json              # ← generated
│   ├── es.json              # ← generated
│   └── .translation-hashes.json
└── blog/translates/
    ├── en.md                # source
    ├── ru.md                # ← generated
    └── es.md                # ← generated

Unified command format

Both commands work the same way: --dir points to the directory containing the English source file. Translations are written into the same directory.

JSON

node-translator translate --dir i18n/locales --all
node-translator translate --dir i18n/locales --all --exclude ru
node-translator translate --dir i18n/locales -l ru,es,fr --exclude ru
node-translator translate --dir i18n/locales --all -f
  • Reads i18n/locales/en.json
  • Writes i18n/locales/ru.json, es.json, ...
  • Hashes: i18n/locales/.translation-hashes.json
  • Default provider: Google (no API key required)

Markdown

node-translator translate-md --dir blog/translates --all
node-translator translate-md --dir blog/translates --all --exclude ru
node-translator translate-md --dir blog/translates -l ru,es --exclude ru
node-translator translate-md --dir blog/translates --all -f
  • Reads blog/translates/en.md
  • Writes blog/translates/ru.md, es.md, ...
  • Requires an OpenAI API key

Providers

| Provider | When | API key | |----------|------|---------| | google | Default for JSON | Not required | | gpt | -p gpt (JSON) or translate-md | OpenAI |

API key resolution order:

  1. -k/--key
  2. OPENAI_API_KEY environment variable
  3. key.txt in the project root
# JSON via Google
node-translator translate --dir i18n/locales -l ru,es

# JSON via GPT
node-translator translate --dir i18n/locales -l ru -p gpt -k $OPENAI_API_KEY

Common flags

| Flag | Description | Default | |------|-------------|---------| | --dir | Directory with en.json / en.md | required | | -l, --locales | Comma-separated locales | ru,es,fr,de | | --all | All locales except en | — | | --exclude | Locales to skip | — | | -f, --force | Re-translate everything / overwrite existing files | — | | -t, --threads | Parallel threads | 5 | | -k, --key | OpenAI API key | env / key.txt | | -m, --model | GPT model | gpt-4o-mini |

Additional flags for translate: -p, --provider (google / gpt)

Additional flags for translate-md: --temperature (0–2, default 1)

Utility commands

node-translator status --dir i18n/locales
node-translator clean --dir i18n/locales
node-translator info

clean removes {locale}.json, {locale}.md, and .translation-hashes.json from the directory. It does not touch en.json or en.md.

Programmatic API

import Translator from 'node-translator-os';

const translator = new Translator({ provider: 'google', maxConcurrent: 5 });
await translator.translateJsonFile('i18n/locales/en.json', ['ru', 'es'], 'i18n/locales');

License

MIT