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

@bf-i18n/cli

v0.5.7

Published

CLI tool for backend-friendly i18n

Downloads

29

Readme

@bf-i18n/cli

CI npm version License: MIT

CLI tool for bf-i18n. Parse, validate, convert, and extract translation keys from Rails/Laravel format files.

Part of the bf-i18n project.

Installation

npm install -g @bf-i18n/cli

Or use with npx:

npx @bf-i18n/cli <command>

Commands

parse

Parse and display translation files (YAML, JSON, PHP).

bf-i18n parse <file>

# Examples
bf-i18n parse locales/en.yml
bf-i18n parse locales/en.json
bf-i18n parse lang/en/messages.php

validate

Validate translation files for consistency across locales.

bf-i18n validate <files...>

# Example
bf-i18n validate locales/en.yml locales/ja.yml locales/fr.yml

Checks for:

  • Missing keys between locales
  • Extra keys in some locales
  • Type mismatches (string vs object)

convert

Convert translation files between Rails and Laravel formats.

bf-i18n convert <file> --from <mode> --to <mode> [--output <file>]

# Examples
bf-i18n convert locales/en.yml --from rails --to laravel
bf-i18n convert lang/en.json --from laravel --to rails --output locales/en.yml

# Check compatibility without converting
bf-i18n convert locales/en.yml --from rails --to laravel --check-only

# Fail on warnings
bf-i18n convert locales/en.yml --from rails --to laravel --strict

Options:

  • --from - Source format (rails or laravel)
  • --to - Target format (rails or laravel)
  • --output, -o - Output file path
  • --check-only - Only check compatibility, don't convert
  • --strict - Fail if there are warnings

extract

Extract translation keys from source code.

bf-i18n extract <dir> [options]

# Examples
bf-i18n extract src/
bf-i18n extract src/ --unique
bf-i18n extract src/ --json
bf-i18n extract src/ --output keys.txt

Options:

  • --unique, -u - Show only unique keys
  • --json - Output as JSON
  • --output, -o - Write results to file

Supported patterns:

  • t('key'), $t('key')
  • i18n.t('key')
  • useTranslation hook patterns

Supported file extensions:

  • .ts, .tsx, .js, .jsx, .vue

Format Differences

Rails Format

en:
  greeting: "Hello, %{name}!"
  items:
    zero: "No items"
    one: "1 item"
    other: "%{count} items"

Laravel Format

en:
  greeting: "Hello, :name!"
  items: "{0} No items|{1} 1 item|[2,*] :count items"

Exit Codes

  • 0 - Success
  • 1 - Error (invalid input, conversion failed, etc.)

License

MIT