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

langcleaner

v1.0.0

Published

Smart i18n maintenance tool: dedupe keys, prune unused translations, and sync nested JSON structures.

Readme

🌍 LangCleaner

The intelligent i18n maintenance toolkit for nested or flat JSON.

LangCleaner is a CLI tool designed to keep your internationalization files clean, synchronized, and perfectly matched to your source code. It doesn't just find problems—it fixes them.


🚀 The Maintenance Pipeline

The most powerful way to use this tool is the maintenance command. It runs a 5-step "Self-Healing" cycle where each step builds upon the last:

  1. Dedupe Finds multiple keys with the same translation (e.g., Save and Apply both being "Submit") and merges them.

  2. Apply Code Updates Automatically renames those keys in your React/Vue/JS source code to match the new merged keys.

  3. Find Unused Keys Scans your code, finds and deletes (if you add --fix) any keys from your JSON that are no longer used.

  4. Find Missing Translations Finds keys you wrote in your code (like t("nav.home")) that don't exist in your JSON yet and adds (if you add --fix) them as empty stubs.

  5. Sync Lang / Sync All Takes your now-perfect English (or other master) file and forces all other languages (tr.json, de.json, etc.) to match its structure perfectly.

Maintenance Pipeline Diagram

         +---------+
         |  Start  |
         +----+----+
              |
              v
        +-----+-----+
        |   Dedupe  |
        +-----+-----+
              |
              v
   +----------+-----------+
   |   Apply Updates       |
   +----------+-----------+
              |
              v
      +-------+-------+
      |   Clean Unused |
      +-------+-------+
              |
              v
      +-------+-------+
      |  Add Missing   |
      +-------+-------+
              |
              v
        +-----+-----+
        |  Sync All  |
        +-----+-----+
              |
              v
         +----+----+
         |  Finish  |
         +---------+

📦 Installation

npm install -g langcleaner

🛠 Commands & Usage

⚡ Full Maintenance (Recommended)

Run the entire pipeline in one go:

langcleaner maintenance ./locales/en.json ./src --fix

Options:

  • --fix: Required to actually update your files. Without it, the tool only generates reports.

🔍 Individual Commands

| Command | Purpose | Sample Usage | | --------------------------- | ------------------------------------ | ------------------------------------------------------------- | | dedupe | Merges duplicate values in JSON | langcleaner dedupe ./locales/en.json --fix | | apply-code-updates | Updates code based on dedupe mapping | langcleaner apply-code-updates ./output/update-mapping.json ./src | | find-unused-keys | Removes dead keys from JSON | langcleaner find-unused-keys ./locales/en.json ./src --fix | | find-missing-translations | Stubs out missing keys in JSON | langcleaner find-missing-translations ./locales/en.json ./src --fix | | sync-lang | Syncs a language to match master | langcleaner sync-lang ./locales/en.json ./locales/de.json | | sync-all | Syncs all languages to match master | langcleaner sync-all ./locales/en.json ./locales |


📂 Understanding the output/ folder

LangCleaner follows a Safety-First approach. It never overwrites your primary master file. Instead, it creates an output/ directory:

output/
└── en/
    ├── cleaned-en.json          <-- Your "Gold Standard" file
    ├── update-mapping.json      <-- Logic used to update code
    ├── unused-keys-report.json  <-- Audit of what was deleted
    └── missing-keys-report.json <-- Audit of what needs translation

Example JSON Snippets

Before dedupe:

{
  "save": "Submit",
  "apply": "Submit",
  "cancel": "Cancel"
}

After dedupe:

{
  "save": "Submit",
  "cancel": "Cancel"
}

Professional Audit Reports

Every report is standardized for your team's review:

  • Config: Shows absolute paths and files scanned.
  • Summary: High-level stats (e.g., "37% of keys were unused").
  • Details: Alphabetical lists of exactly which keys were changed.

💡 Pro-Tips

  • Always use a Master: Choose one language (usually English) as your master path.
  • Dry Run: Run commands without --fix first to see the JSON reports and verify changes.
  • Commit First: Always commit your code to Git before running with --fix so you can easily revert if needed.