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

locale-grubber

v0.1.9

Published

Scans files for localization tokens and create translate json files

Downloads

25

Readme

locale-grubber

The picker to search and create/edit translate json files.

Installation

Using npm:

$ npm install --dev locale-grubber

Create config (see config section).

Using

Run

$ locale-grubber --help
Usage: index [options] <rootDir> [otherRootDirs...]

Scan <rootDir> and [otherRootDirs] and write locale files

Options:
  -c, --config <config>  Path to config (default: "/home/borro/projects/ng-localizer/locale-grubber.config.json")
  -h, --help             output usage information
  --validate             Validate files instead of rewrite. Logs erroneous files names to console

Config

{
    "includeDirs": [
        "shared/",
        "plugins/*/",
        "plugins/settings/*/"
    ],
    "excludeDirs": [
        "plugins/settings"
    ],
    "fileRules": [
        {
            "include": ["**/*.ts", "**/*.html"],
            "exclude": ["**/*.spec.ts"],
            "grubbers": {
                "regexp": {
                    "keyRules": [
                        "namespace",
                        "camelCase"
                    ],
                    "patterns": [
                        "name: *'(?<token>[.\\w-]+)', *(routerLink|children)",
                        "[`'\"](?<token>[aA-zZ0-9._\\-]*)[`'\"] *\\| *translate",
                        "[`'\"](?<plural>[aA-zZ0-9._\\-]*)[`'\"] *\\| *pluralize[^|]*\\| *translate",
                        "\\.instant\\([`'\"](?<token>[.\\w-]+)[`'\"]+\\)",
                        "__\\([`'\"](?<token>[aA-zZ0-9._\\-]*)[`'\"]\\)",
                        "@translate +[`'\"]?(?<token>[aA-zZ0-9._\\-]*)[`'\"]?"
                    ]
                }
            }
        }
    ],
    "i18nDirName": "i18n",
    "languages": ["ru", "en"],
    "i18nextPlural": "v1"
}
  • includeDirs — Dirs to scan
  • excludeDirs — Dirs for exclude
  • fileRules — rules for parsing
    • include — which file to grub
    • exclude — which file to exclude from grubbing
    • grubbers — supported technologies for file parsing (currently regexp only):
      • regexp — grub file by Regexp
        • patterns — use named group "token", for capture token, or "plural", for capture token for plural. Examples:
          • ['"](?[aA-zZ0-9._\-]*)['\"] *\\| *translatetoken.for.translate' | translate
          • ['"](?[aA-zZ0-9._\-]*)['\"] *\\| *pluralize[^|]*\\| *translatetoken.for.pluralize' | pluralize:count | translate
          • __\\(['"](?[aA-zZ0-9._\-]*)['\"]\\)__('token.for.translate')
          • @translate +['"]?(?[aA-zZ0-9._\-]*)['\"]?@translate token.in.comment
  • i18nDirName — name for localization dir
  • languages - languages in project (create files and keys for all added languages)
  • i18nextPlural - create plural forms for i18next, possible values:
    • "v1" — use json version v1, example token, token_plural_2, token_plural_5
    • "v2" — use json version v2, example token_1, token_2, token_5
    • "v3" — use json version v3, example token_0, token_1, token_2
    • "v4" — use json version v4, example token, token_few, token_other
    • false or not defined — disabled

Additional

  • ignore next line with "locale-ignore-next" comment