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

i18n-audit

v1.2.3

Published

Convert i18n JSON <-> CSV, detect unused and undefined translations, and translate between languages.

Readme

i18n-audit

🛠️ A CLI tool for auditing, converting, and managing i18n translation files using CSV. Supports converting between JSON/JS translation files and CSV, detecting unused or variable-based keys, and generating actionable reports.

It depends on ripgrep to find translation key occurrences in your project. It is only required for generating reports—if you don't use this feature, you don't need to install it

💡 Why This Tool Exists

Managing i18n translations can be painful — especially when collaborating with non-technical translators or using external tools like Google Sheets.

✨ Features

  • ✅ Convert translation .json or .js files to CSV or HTML (supports both CommonJS and ES module formats)
  • ✅ Revert .csv back to translation .json
  • ✅ Detect unused, undefined, or variable-based keys
  • ✅ Generate an audit report for manual inspection (HTML output format recommended)
  • ✅ Show source references for easy location (file:line:col)
  • ✅ Translate via local or remote LibreTranslate instance — easy to run locally using Docker

It's designed for both developer sanity and translator friendliness.


⚠️ Warning

This tool may not detect all unused and undefined keys in your codebase.

  • It assumes you're using standard translation functions like $t('key') or t('key') and for interpolation t('key.'+variableName) or t(`key.${variableName}`).
  • If your project uses custom wrappers, renamed translation functions, or dynamic key generation, some keys may be missed.
  • Use the audit report to manually review potentially dynamic or ambiguous keys.

Always verify results manually when in doubt.


📦 Installation

Run via npx (or install globally with -g if you prefer):

npx i18n-audit -i your-translation-file.json

🚀 Usage Examples

1. Audit a translation file

npx i18n-audit -i en.json -o report.html --audit --to html

2. Convert between JS/JSON/CSV

npx i18n-audit -i en.json -o en.csv
npx i18n-audit -i tr.js -o tr.csv
npx i18n-audit -i en.csv -o en.json

3. Just print audit report to stdout

npx i18n-audit -i en.json --audit

4. Translate using local LibreTranslate server

npx i18n-audit -i en.json -o tr.json --format json --translate tr-en

🧩 Options

npx i18n-audit -h
Usage: i18n-audit [options]

Convert i18n JSON <-> CSV, detect unused and undefined translations, and translate between languages.

Options:
  -V, --version              output the version number
  -i, --input <file>         Input file (.json, .js, or .csv)
  -o, --output <file>        Output file path (defaults to stdout)
  --to <format>              Convert to "csv" or "json" (based on input) (default: "csv")
  -t, --translate <from-to>  Translate using source-target languages (e.g., en-tr)
  --audit                    Audit for undefined and unused keys in translation files
  --src <dir...>             Source code directory to scan for used keys (can be used multiple times) (default: ["."])
  --loose                    Search for loosely-matched strings (quoted text not inside $t or other i18n calls)
  --api-url <url>            Optional translation API endpoint (LibreTranslate) (default: "http://localhost:5000")
  --api-key <key>            Optional API key for the translation service
  --chunk-size <n>           Number of entries per API request batch (default: 10)
  --chunk-delay <ms>         Delay between each chunk in milliseconds (default: 500)
  -h, --help                 display help for command

📄 License

MIT