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

tpo-deepl

v1.2.4

Published

Translate missing entries in .po files using DeepL

Readme

tpo-deepl

Translate missing entries in .po files using DeepL — and detect duplicates for better translation memory management.

tpo-deepl is a CLI tool for modern gettext-based i18n workflows. It combines:

  • DeepL-based auto-translation for missing msgstr entries.
  • Advanced duplicate detection to identify redundant or overly similar translations.
  • ✅ Designed for localization teams who want automation without sacrificing quality.

🚀 Installation

Install globally using pnpm:

pnpm install -g tpo-deepl

⚙️ Setup

1️⃣ Get your DeepL API key

Sign up at deepl.com/pro — free up to 500,000 characters/month.

2️⃣ Configure your environment

You can either:

# .env file:
DEEPL_API_KEY=your-key-here

or export it directly:

export DEEPL_API_KEY=your-key-here

3️⃣ Create a config file

In your project root, create tpo.config.json or tpo.config.ts:

{
  "localesPath": "./src/locales/{locale}/messages.po",
  "mainLanguage": "de"
}
  • Use {locale} placeholder where the language codes are located.
  • Make sure your file paths point to valid .po files.

🔧 Commands

tpo translate

Auto-translate all missing .po entries using DeepL.

tpo translate [options]

Options

| Option | Description | | --------------------- | ------------------------------------------------------------------------ | | --dry-run | Preview translations without modifying files | | --formality <level> | DeepL formality: less, more, prefer_less, prefer_more, default | | --only <lang> | Translate only specific language (e.g. fr) | | --silent | Suppress output | | --config <path> | Use a custom config file instead of default |

Examples

Translate all missing entries with formal tone:

tpo translate --formality more

Translate only French:

tpo translate --only fr

Preview changes without modifying files:

tpo translate --dry-run

tpo duplicates

Detect duplicate translations inside your .po files.

tpo duplicates [options]

Default mode

By default, detects strict identical msgstr duplicates per language file.

Advanced near-duplicate detection

| Option | Description | | ----------------------- | ------------------------------------------------------------------ | | --words <number> | Minimum consecutive words to match | | --similarity <number> | Allow small gaps inside consecutive matches (only with --words) | | --only <lang> | Limit scan to specific language | | --strict | Fail with non-zero exit code if duplicates are found (CI friendly) |

Examples

Detect strict duplicates (default):

tpo duplicates

Detect duplicates with at least 3 consecutive identical words:

tpo duplicates --words 3

Detect duplicates allowing 1 mismatch inside a 3-word sequence:

tpo duplicates --words 3 --similarity 1

Limit detection to German:

tpo duplicates --only de

📝 License

MIT