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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hovrcat/sync-i18n

v1.2.4

Published

Command line tool that takes the hassle out of keeping your JSON i18n files in sync

Downloads

3

Readme

Sync Translations

Command line tool that takes the hassle out of keeping your JSON i18n files in sync

Installation

npm i -g @hovrcat/sync-i18n

Local setup

npm install

Run tests

npm run test

Usage

insync

| Options | Required | Default | Description | | --- | --- | --- | --- | | -d, --debug | ❌ | false | Enables debug logging | | --dir | ❌ | ./i18n | Specify the directory where the i18n files exist |

Commands

validate

Compare some or all translation files against one provided as root

| Parameters | Required | Description | | --- | --- | --- | | root file | ✔ | The root language file against which comparison will be made | | lang files | ❌ | Translation file names to be validated, space separated. If no file names are passed, all in the provided i18n directory will be validated (except for the root file) |

Example: insync [--dir path/to/i18n] validate en.json [xx.json yy.json zz.json ...]

add

Launches an interactive prompt that guides you through adding new keys in the files

| Option | Required | Description | | --- | --- | --- | | -o, --order | ❌ | Instruct the tool to order the keys after adding the new key |

| Prompt | Description | | --- | --- | | New key path | A valid JSON path to be created. If the paths already exists, the value will be overwritten | | Value for [i18n file].json file | Parses the i18n dir and asks for values for the specified key path, for all i18n files | | Is this correct? | Confirmation of validity of the provided information |

Example: insync [--dir path/to/i18n] add [--order]

sort

Standalone command to sort the json keys in all i18n files alphabetically

Example: insync [--dir path/to/i18n] sort

Upcoming features

  1. root file and i18n files to be validated should be passed with flags, to improve readability
    • insync [--dir path/to/i18n] validate --root en.json [--files xx.json yy.json zz.json ...]
  2. Remove command - like add the command, it would receive a key path and remove it from all i18n files in the provided i18n dir
  3. Fix command - at the moment, the validate command outputs the any inconsistencies between files. You should have the option of fixing the issues
    • if a key path is missing, start the prompt and request a value
    • if an orphan key is present, remove it automatically
    • output a report of the actions taken