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

@bluecateng/l10n-cli

v0.4.0

Published

Command line utilities for l10n

Readme

@bluecateng/l10n-cli

Command line utilities for l10n.

Upgrading from an older major version? See the migration guide.

Installation

npm i -D @bluecateng/l10n-cli

The command line is a native executable, the package contains the executables for these platforms:

  • macOS on Apple silicon (arm64) and Intel (x64).
  • Linux on arm64 and x64, the executables are statically linked so they run on any distribution, including the ones which use musl, such as Alpine.

When installed with npm, an install script replaces the l10n-cli command with the executable for the current platform, so it runs without starting Node. If the install script does not run (other package managers, --ignore-scripts, or npm blocking the install scripts of dependencies), the command starts Node to run the executable, which takes a few more milliseconds. To allow the install script with npm:

npm install-scripts approve @bluecateng/l10n-cli

Because the install script puts the executable for the current platform in place of the command, a node_modules directory installed on one platform does not work on another. For example, node_modules installed on macOS and then copied or mounted into a Linux container fails with "exec format error". Install the dependencies on the platform where the command runs, for example by running npm ci inside the container and excluding node_modules from what is copied into it (.dockerignore).

Configuration

Add an object with this format to package.json. All paths are relative to the directory where package.json is located. The configuration is searched in the package.json of the current directory and its ancestors. Other configuration files (.bc-l10nrc, .bc-l10nrc.json, .bc-l10nrc.yaml, bc-l10n.config.js, etc.) are not supported.

"bc-l10n": {
  "hashLength": <number>,
  "sourcePath": <string>,
  "module": <string>,
  "catalogPath": <string>,
  "locales": <Array<string>>
}

hashLength

To save space in production the code only contains a hash of the original string. This field specifies the length to which the hashes will be truncated. It should be the minimum length which avoids clashes, clashes are validated at build time.

  • Required: yes
  • Example: 3

sourcePath

The path to the sources.

  • Required: no
  • Default: "src"

module

The path to the module which loads the strings (see @bluecateng/l10n-core).

  • Required: yes
  • Example: "src/l10n"

catalogPath

The path where the message catalog files will be created. It must contain the token "{locale}" which will be replaced with the corresponding locale. It must not contain an extension, the extension will be appended on generation.

  • Required: yes
  • Example: "src/l10n/{locale}"

locales

List of BCP-47 locale codes.

  • Required: no
  • Default: ["en"]
  • Example: ["en", "fr"]

Usage

Extracting strings

The command line can be used in two modes:

  • during development to extract strings from individual files for a single locale.
  • before committing to extract strings from all source files for all configured locales.

npx @bluecateng/l10n-cli [ -c ] [ -l <locale> ] [ <file-paths> ... ]

-c, --clean

Removes the obsolete entries from the catalogs.

-l, --locale

The single locale code to update. If not specified, all the configured locales will be updated, and the entries which are no longer used are marked as obsolete.

-h, --help

Prints the usage and exits.

file-paths

The paths to the source files from which strings will be extracted. If not specified, all the source files will be scanned.

Building catalogs

Compiles the .po catalog for every configured locale into a .po.js module that can be imported directly (see @bluecateng/l10n-core).

npx @bluecateng/l10n-cli build <outDir>

outDir

The directory where the compiled .po.js files will be written. Each catalog is written at the path corresponding to its catalogPath, made relative to sourcePath and rooted at outDir.

  • Example: with sourcePath "src" and catalogPath "src/l10n/{locale}", the en catalog is written to <outDir>/l10n/en.po.js.

The messages can use the number, date and time argument types with the styles supported by Intl.NumberFormat and Intl.DateTimeFormat, skeletons (::currency/USD) are not supported. Obsolete entries are not included.

Supported syntax

The source files are parsed as TypeScript, files with the extensions .js, .jsx and .tsx can also contain JSX. JSX is not allowed in .ts files, where it would conflict with type assertions (<Type>value).

Proposals which are not yet part of the language, such as do expressions, are not supported and are reported as syntax errors.

Usage as a file watcher in JetBrains IDEs (WebStorm/IDEA)

This configuration can be added under Settings > Tools > File Watchers.

PO file watcher configuration