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

@gravity-ui/i18n-cli

v1.3.2

Published

- Provides i18n configuration for the project

Downloads

675

Readme

@gravity-ui/i18n-cli

  • Provides i18n configuration for the project

  • Provides the i18n-cli command for managing language files in the project.

Project Setup

  1. Install the package:

    npm i -D @gravity-ui/i18n-cli
  2. Createthe config file i18n.config.ts in the project root:

    import {defineConfig} from '@gravity-ui/i18n-cli/config';
    
    export default defineConfig({
        allowedLocales: ['ru', 'en', 'ru-kz', 'en-kz'] as const,
        fallbackLocales: {
            'ru-kz': 'ru',
            'en-kz': 'en',
        },
        defaultFallback: 'en',
        clientIntlModule: {
            path: 'src/shared/i18n/intl.ts',
            alias: '@shared/i18n',
        },
    });
  3. Import the config in the i18n library instance (i18n-react and i18n-node)

    import {createIntl} from '@gravity-ui/i18n-react';
    import i18nConfig from '../../../i18n.config';
    
    const {allowedLocales, fallbackLocales, defaultFallback} = i18nConfig;
    
    export const intl = createIntl({
        allowedLocales,
        fallbackLocales,
        defaultFallback,
    });

Commands

create-keys

Checks the provided file/directory for calls to missing keys and adds them to the i18n.ts file.

Run for a single file

npx i18n-cli create-keys src/ui/SomeComponent/SomeComponent.tsx

Run for all files in a directory

npx i18n-cli create-keys src/ui/ComponentDirectory

find-unused

Recursively search for unused keys starting from the specified directory.

Report on unused keys

npx i18n-cli find-unused src/ui/SomeComponent

Delete unused keys

npx i18n-cli find-unused -d src/ui/SomeComponent

Configuration options

allowedLocales

Type: string[]

Allowed locales in the project.

{
    allowedLocales: ['ru', 'en'] as const,
}

fallbackLocales

Fallbacks for given locales. More details can be found in i18n-core.

defaultFallback

Default fallback. Used if no higher priority fallback is found. More in i18n-core.

clientIntlModule

Location of the library instance for the client-side i18n-react in the project.

{
    clientIntlModule: {
        // Path to the module with intl library instance
        path: 'src/ui/shared/i18n.ts',

        // TypeScript alias of the module with intl library instance
        alias: '@shared/i18n';
    }
}

serverIntlModule

Server-side library instance location i18n-node in the project.

{
    serverIntlModule: {
        // Path to the module containing the intl library instance
        path: 'src/server/utils/i18n.ts',

        // TypeScript alias of the module containing the intl library instance
        alias: undefined,

        // Regular expressions that determine if a module belongs to the server-side
        pathMatchers: [/src\/server\/.+$/]
    }
}