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

@lingo.dev/spec

v1.26.0

Published

Readme

@lingo.dev/spec

The rules every Lingo.dev package and the CLI share: how a message key is derived, how plural and select messages are written in ICU, how a locale file is read, and how a locale's messages are loaded at runtime. Framework-free; jsonc-parser is its only dependency.

Getting started

import { createCatalog } from "@lingo.dev/spec";

// Locale files compiled by lingoCatalog() from @lingo.dev/vite
export const catalog = createCatalog(import.meta.glob("../locales/*.jsonc", { query: "?lingo" }), {
  sourceLocale: "en",
});

const messages = await catalog("de");

On a server that reads locale files itself, compileCatalog(await readFile(file, "utf8"), file) returns the same { key: value } map.

API

| Export | Does | | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | createCatalog(modules, { sourceLocale? }) | A Catalog, (locale) => Promise<Record<string, string>>, over import.meta.glob("…/*.jsonc", { query: "?lingo" }). It memoises one promise per locale, answers {} for a locale without a file or one that fails to load, and ships no file for sourceLocale when NODE_ENV is production, since every lookup falls back to the source string. Deprecated: { query: "?raw" } still works, parsed in the browser by a lazily loaded parser with a one-time development warning. | | compileCatalog(content, file) | The active entries of a locale file as { key: value }: comments and @orphan entries are dropped, and values, ICU included, pass through unchanged. A malformed file or a value that is not a string throws with the file, line and column. | | readLocaleFile(content) | { entries }, each { key, value, metadata } with the @context, @src and @orphan read from the comment before it. Syntax errors throw. | | getActiveEntries(entries) | The entries without metadata.orphan. | | computeKey(source, context?) | The key of a source string and its optional context, the same in every package and the CLI. | | buildIcuPlural(forms), buildIcuSelect(forms) | An ICU plural with the known categories in canonical order, or a select with sorted keys. |

Gotchas

compileCatalog and the JSONC parser it needs build into their own chunk, which createCatalog loads only for a ?raw file. An app that only reads compiled ?lingo modules ships neither.