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-json-helper

v0.0.1

Published

This is a tool to help you easily deal with the json file management troubles caused by i18n

Readme

i18n-json-helper

  • Auto-Completion of Missing JSON Files and Fields in Other Languages Based on Base Language
  • Automatic Simplification of Redundant Fields in Other Languages Based on Base Language
  • Replacement of JSON with User-Provided Translations

Usage

Install

pnpm i -D i18n-json-helper

Create config file

// ijh.config.js
import { defineConfig } from 'i18n-json-helper'

export default {
  localesDir: './locales', // i18n json dir path. default: './locales'
  baseLang: 'en',  // baseLang. default: 'en'
  targetLangs: ['cn'], // targetLangs. default: []
  space: 2,  // json stringify space num. default: 2 
  mode: 'separate', // json mode,Is one JSON file containing multiple languages, or does each language have its own separate JSON file. default: 'separate'
  outputDir: './ijh-needTranslate', // The generated files to be translated dir. default: './ijh-needTranslate'
  translateFn: (baseLangText, targetLang) => {}, // If provided, during the synchronization of JSON, this function will use the returned result as the content for other JSON items that require translation. default: undefined
  translationDir: './ijh-translation'  // Directory containing translated JSON files, used for replacing JSON during the translation process. default: './ijh-translation'
}

Auto complete

ijh -c or ijh --complete

without translateFn

  • separate mode
// before
// locales/en/home.json
{
  "title": "en home title",
  "foo": "en foo"
};
// locales/cn/home.json
{
  "title": "cn home title" // Missing field foo
}

// after ijh -c
// locales/cn/home.json
{
  "title": "cn home title", 
  "foo": "en foo" // Automatically fill in missing fields
}

// Simultaneously generate ijh-needTranslate/cn/home.json
{
  "foo": "en foo"
}
  • single mode
// before
// locales/home.json
{
  "en": {
    "title": "en home title",
    "foo": "en foo"
  },
  "cn": {
    "title": "cn home title" // Missing field foo
  }
};

// after ijh -c
// locales/home.json
{
  "en": {
    "title": "en home title",
    "foo": "en foo"
  },
  "cn": {
    "title": "cn home title",
    "foo": "en foo" // Automatically fill in missing fields
  }
};

// Simultaneously generate ijh-needTranslate/home.json
{
  "cn": {
    "foo": "en foo"
  }
}

config translateFn

translateFn: (baseLangText, targetLang) => `${baseLangText} -> ${targetLang}`
// before
// locales/en/home.json
{
  "title": "en home title",
  "foo": "en foo"
};
// locales/cn/home.json
{
  "title": "cn home title" // Missing field foo
}

// after ijh -c
// locales/cn/home.json
{
  "title": "cn home title", 
  "foo": "en foo -> cn" // Automatically fill in missing fields  use translateFn return value
}

// Simultaneously generate ijh-needTranslate/cn/home.json
{
  "foo": "en foo -> cn"
}

Auto simplify json

ijh -s or ijh --simplify

// before
// locales/en/home.json
{
  "title": "en home title"
}

// locales/cn/home.json
{
  "title": "cn home title",
  "foo": "foo"  // Excess fields.
}

// after ijh -s
// locales/cn/home.json
{
  "title": "cn home title"
}

Auto replace json

ijh -r or ijh --replace



// before
// ./locales/cn/home.json
{
  "title": "need translate cn home title"
}

// ./ijh-translation/cn/home.json  Translated JSON files
{
  "title": "translated cn home title"
}

// after ijh -r
// ./locales/cn/home.json
{
  "title": "translated cn home title"
}