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

@ai-translate/next

v0.1.1

Published

Auto-discovery for Next.js localization setups: detects next-intl and i18next projects, infers locales and message layout, and generates an ai-translate config.

Readme

@ai-translate/next

Auto-discovery for Next.js localization setups. Given a project directory, it works out which i18n library is in use, where the messages live, which locales exist, and which one is the source — then renders an ai-translate.config.ts for it.

This is the engine behind ai-translate init. Use it directly if you want detection results as data.

Install

npm install @ai-translate/next

Usage

import { detectProject, renderConfig } from "@ai-translate/next";

const setups = await detectProject(process.cwd());

for (const setup of setups) {
  console.log(setup.integrationId, setup.confidence);
  for (const item of setup.evidence) {
    console.log(`  ${item.detail} (${item.source})`);
  }
}

if (setups[0]) {
  console.log(renderConfig(setups[0].plan));
}

detectProject returns every match, best first. A repository midway through a migration legitimately matches more than one.

What it recognises

| Integration | Detected from | Message layout | Message format | | --- | --- | --- | --- | | next-intl | the next-intl dependency, i18n/request.ts, i18n/routing.ts | messages/{locale}.json or messages/{locale}/{namespace}.json | ICU | | i18next | i18next, react-i18next, or next-i18next, plus a settings module | public/locales/{locale}/{namespace}.json | i18next, with suffix-keyed plurals |

Both look under the project root and under src/.

Detection is read-only

Nothing is written and no project code is executed. Config modules are read as text and scanned for literal locales arrays and defaultLocale strings, never imported — importing a Next.js config would pull in plugins, environment access, and arbitrary side effects. Anything computed rather than written out literally is simply not found, and detection falls back to reading locale directory names.

That fallback is reported rather than hidden: the resulting plan carries a warnings entry, and renderConfig turns each warning into a // TODO: comment in the generated file.

Writing your own integration

An integration is a detector. It receives a read-only view of the project and either returns a plan or null.

import { defineIntegration, detectProject } from "@ai-translate/next";
import type { Integration } from "@ai-translate/next";

const paraglide: Integration = defineIntegration({
  async detect(context) {
    const manifest = await context.packageJson();
    if (manifest?.dependencies?.["@inlang/paraglide-js"] === undefined) {
      return null;
    }

    const locales = await context.listDirectories("messages");
    return {
      confidence: 0.9,
      displayName: "Paraglide",
      evidence: [{ detail: "Paraglide is a dependency", source: "package.json" }],
      integrationId: "paraglide",
      plan: {
        catalog: { kind: "document-json", rootDir: "messages" },
        messageFormat: "icu",
        sourceLocale: "en",
        targetLocales: locales.filter((locale) => locale !== "en"),
        warnings: [],
      },
    };
  },
  displayName: "Paraglide",
  id: "paraglide",
});

const setups = await detectProject(process.cwd(), { integrations: [paraglide] });

Passing integrations replaces the shipped set. ai-translate init accepts the same option.

Confidence only ranks candidates. Keep it below 1 unless the evidence is conclusive, and reserve the high end for cases where both a dependency and a recognised message layout are present — a dependency alone is not enough, since a project can depend on a library it no longer uses.

License

MIT