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

@gzbapp/i18n

v2.0.0

Published

多语言基础库,基于 i18next 与 react-i18next,支持语言包加载、后端语言包拉取与语言切换。

Readme

@gzbapp/i18n

多语言基础库,基于 i18next 与 react-i18next,支持语言包加载、后端语言包拉取与语言切换。

2.x.x 版本技术栈

正式版起点为 2.0.0,面向 React 18 项目。

React 18 集成;i18next ^23.11.5、react-i18next ^13.5.0、@gzbapp/utils ^0.2.16;TypeScript 源码,microbundle ^0.12.0-next.8 构建。本包未直接声明 React / React DOM peerDependencies,React 集成依赖由使用方提供。

安装

yarn add @gzbapp/i18n

快速开始

import i18n, { initial, addAppBundles, AvailableLanguge, t } from '@gzbapp/i18n'

await initial({
  supportBackend: true,
  backendName: 'demo',
})

addAppBundles({
  [AvailableLanguge.zh]: { hello: '你好' },
  [AvailableLanguge.en]: { hello: 'hello' },
})

t('hello')

主要能力

  • 语言初始化与自动检测
  • 语言包增量加载(addBundle / addAppBundles / addCommonBundles)
  • 运行时切换语言(changeLanguage)
  • 兼容 React 组件侧的 hooks 与 HOC(来自 react-i18next)

主要导出

  • initial / addBundle / addAppBundles / addCommonBundles
  • getCurrentLanguage / changeLanguage / t
  • AvailableLanguge / AvaliableNameSpace