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

@kiwa-lab/i18n

v2.1.0

Published

i18n provider mock harness for kiwa — next-intl / vue-i18n / react-i18next / Lingui を統一 interface で invoke する in-process mock。 translate / locale switch / interpolation ({{name}}) / pluralization (one / other / few / many) / fallback locale / missing key

Readme

@kiwa-lab/i18n

i18n (translation + locale + interpolation + plural) mock harness for kiwa — next-intl / vue-i18n / react-i18next / Lingui の 4 pattern を in-process で叩く test infra。

Installation

pnpm add -D @kiwa-lab/i18n
# or
npm install -D @kiwa-lab/i18n
# or
yarn add -D @kiwa-lab/i18n

Supported providers

| Provider | Status | Interpolation | Plural | |---|---|---|---| | next-intl | ✅ | {{name}} | Intl.PluralRules | | vue-i18n | ✅ | {{name}} | Intl.PluralRules | | react-i18next | ✅ | {{name}} | Intl.PluralRules | | Lingui | ✅ | {{name}} | Intl.PluralRules |

Quick start

import { createI18nClient, interpolate, selectPlural } from '@kiwa-lab/i18n';

const client = createI18nClient({
  provider: 'next-intl',
  locale: 'ja',
  fallbackLocale: 'en',
  messages: {
    ja: { greeting: 'こんにちは {{name}}', items: '{{count}} 個' },
    en: { greeting: 'hello {{name}}', items: '{{count}} items' },
  },
});

const r = client.translate('greeting', { values: { name: 'kiwa' } });
// r = { text: 'こんにちは kiwa', locale: 'ja', used: 'primary' }

client.setLocale('en');
const r2 = client.translate('items', { values: { count: 3 }, count: 3 });

const num = client.formatNumber(1234.5); // Intl.NumberFormat 経由
const cat = selectPlural('en', 1); // 'one'

API reference

  • createI18nClient(options?: CreateI18nClientOptions): I18nClient — provider + messages + locale で mock 生成
  • I18nClient.translate(key: string, options?: TranslateOptions): TranslateResult — 翻訳 (missing / fallback / default 判定込み)
  • I18nClient.setLocale(locale: Locale): void — locale 切替
  • I18nClient.formatNumber(value, options?) / formatDate(value, options?) — Intl 経由 format
  • interpolate(template, values): InterpolateResult{{key}} 単独 interpolation
  • translate(input: TranslateInput): TranslateResult — pure translator (client なし)
  • selectPlural(locale, count): PluralCategory — Intl.PluralRules 相当

Test integration

import { describe, expect, it } from 'vitest';
import { createI18nClient } from '@kiwa-lab/i18n';

describe('greeting locale', () => {
  it('ja locale = 日本語 message', () => {
    const c = createI18nClient({ locale: 'ja', messages: { ja: { hi: 'やあ' } } });
    expect(c.translate('hi').text).toBe('やあ');
  });
});

/kiwa-i18n skill を起動すると interpolation + plural + fallback + missing 4 経路の test を生成できる。

License

UNLICENSED — see cardene777/kiwa for repo terms.