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

@telorun/message-format

v0.136.0

Published

Telo's message core: a closed profile of Unicode MessageFormat 2 — placeholders, plural selection, CLDR plural rules and decimal formatting from pinned CLDR data, and RFC 4647 language lookup. No Intl, no dependencies; one answer in Node, Rust and every b

Readme

@telorun/message-format

Telo's message core: a closed profile of Unicode MessageFormat 2, read into a plain-JSON model and formatted with pinned CLDR 48.2 data. It has no dependencies and calls no Intl, so a message formats identically in Node, in Rust (telorun-message-format) and in every browser.

import { formatMessage, lookupLanguage, readMessage } from "@telorun/message-format";

const read = readMessage({
  plural: "count",
  cases: { "=0": "No files", one: "{$count} file", other: "{$count} files" },
});
if (!read.ok) throw new Error(read.problems[0].message);

formatMessage(read.message, "en", { count: 0n }); // "No files"
formatMessage(read.message, "en", { count: 1234n }); // "1,234 files"
lookupLanguage("pl-PL", ["en", "pl"]); // "pl"

The profile

  • A pattern is text with {$name} placeholders and the escapes \{, \} and \\. A name follows the Telo name rule: a letter or _ first, then letters, digits or _, and not a CEL reserved word. Inside the braces, the whitespace and bidi marks MF2 allows are accepted. Anything else MF2 can write in braces is refused: a literal, a function, an option, an attribute or markup.
  • A plural selection is written { plural: <name>, cases: { <category> | =<integer>: Message } }. other is required. A case is itself a Message, so selections nest. =N keys are canonical integers inside int64 ∪ uint64.
  • A text is a Message, or { text: Message, context } with a non-empty context.

What it answers

| Function | Answer | | --- | --- | | parsePattern, serializePattern | A pattern's parts, and its one canonical spelling. | | readMessage, readText | The model, or every fault as MESSAGE_SYNTAX_INVALID with its path and, inside a pattern, its UTF-16 range. | | messageIdentity, textIdentity | A source text's key: the pattern reached by taking other at every selection, canonically written, plus its context. | | messageVariables | Every placeholder and selector a message reads. | | unknownVariables | MESSAGE_PLACEHOLDER_UNKNOWN for each name a translation reads that its source does not. | | pluralCategories, invalidPluralCategories | A language's CLDR categories, and MESSAGE_PLURAL_CATEGORY_INVALID for each case naming one it lacks. | | formatNumber, pluralCategory, pluralCategoryOfDecimal | A number's text and category in a language. | | formatMessage | The text. Refuses with MESSAGE_PLACEHOLDER_UNBOUND when a name the message reads has no value, on any branch. Refuses with MESSAGE_PLACEHOLDER_VALUE_UNSUPPORTED for a value other than a string or a number, and for a selector that is not a number. | | truncationChain, lookupLanguage | RFC 4647 lookup: pl-Latn-PL → pl-Latn → pl, case-insensitive. null when nothing matches, and the caller then uses its source. |

Numbers

A number's text depends on its value alone, never on its host type:

  • A bigint inside int64 ∪ uint64 is written exactly, however large.
  • A number is a double: its shortest round-trip decimal, rounded half-to-even to the pattern's maximum fraction digits, with trailing zeros dropped and a zero result unsigned. So 1.0 is "1", and in en it selects one.
  • A non-finite double is refused.

The text then takes the language's CLDR standard decimal pattern, grouping (with minimumGroupingDigits), default-numbering digits, decimal separator and minus sign. Plural selection reads the operands of that rounded decimal. =N cases match numerically before the categories.

CLDR data

The data is CLDR 48.2 for every locale, generated into message-format/cldr/ from the exact-pinned cldr-core and cldr-numbers-full. A tag resolves through CLDR's own inheritance and ends at the root (other only, Latin digits, #,##0.###):

  • Number data goes through parentLocales, then the nonlikelyScript rule, then truncation.
  • Plural rules go through CLDR's plurals parent map.

The data is used under the Unicode License V3. The package ships the licence as LICENSE-CLDR, and every build of the core carries it as a /*! */ notice that survives bundling.