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

@starci/next-i18n

v0.1.0

Published

The next-intl stack of a StarCi Next.js front end, written once and generic over the app's locales: the typed routing config (defineI18n), the locale-negotiating proxy, the locale-aware navigation, the request config that loads the app's own message catal

Downloads

571

Readme

@starci/next-i18n

The next-intl stack of a StarCi Next.js front end, written once (FE-I18N-1) and generic over the app's locales. The app names its locales and keeps its message catalogs; the routing, the proxy, the navigation, the request config and the locale read of the [locale] layout come from here. No component, no class string, no lifecycle of its own (FE-PACKAGES-2).

| entry | export | what it is for | |---|---|---| | @starci/next-i18n | defineI18n(options) | the locales, the default, the time zone, the prefix mode and the cookie in one typed value: routing for next-intl, isLocale, localeOf, intlTagOf. Client-safe. | | @starci/next-i18n/proxy | createProxy(i18n, options?) | the proxy of src/proxy.ts: locale negotiation, except for the roots the app lists and files with an extension | | @starci/next-i18n/navigation | createI18nNavigation(i18n) | locale-aware Link, redirect, usePathname, useRouter, getPathname | | @starci/next-i18n/request | createRequestConfig(i18n, { app, loadMessages, readRouteLocale? }) | the default export of modules/i18n/request.ts that next-intl's plugin loads | | @starci/next-i18n/layout | createReadLocaleSegment(i18n) | the readLocaleSegment(params) a [locale] layout calls; an unknown locale is a 404 |

The proxy, the navigation and the server entries are separate subpaths because they run under different React export conditions: the proxy must never evaluate the navigation.

In an app

// modules/i18n/routing.ts: the one description of the languages
export const i18n = defineI18n({ locales: ["vi", "en"], defaultLocale: "vi", timeZone: "Asia/Ho_Chi_Minh" })

// src/proxy.ts
export const proxy = createProxy(i18n)

// modules/i18n/request.ts: the app only names its catalogs
export default createRequestConfig(i18n, { app: "web", loadMessages: (locale) => import(`./messages/${locale}.json`) })

// app/[locale]/layout.tsx
const { locale, messages, timeZone } = await createReadLocaleSegment(i18n)(props.params)

With experimental.rootParams the request config reads the locale from the route: readRouteLocale: () => locale() (from next/root-params).

Tests

npm test typechecks, lints and runs the node:test specs under 90% line coverage; the specs drive next-intl's real middleware and navigation in Node (src/next-esm.setup.ts resolves Next's bare subpaths the way a bundler does and is no part of the package).

next (>= 16) and next-intl (>= 4) are peers, the versions of the app's stack.