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 🙏

© 2025 – Pkg Stats / Ryan Hefner

messageformat

v4.0.0

Published

Intl.MessageFormat / Unicode MessageFormat 2 parser, runtime and polyfill

Readme

This library provides a formatter and other tools for Unicode MessageFormat 2.0 (MF2), the new standard for localization developed by the MessageFormat Working Group.

This includes a formatter that can be used as a polyfill for the proposed ECMA-402 Intl.MessageFormat formatter.

The API provided by this library is current as of the LDML 48 (October 2025) version of the MF2 specification.

npm install --save messageformat
import { MessageFormat } from 'messageformat';
import { DraftFunctions } from 'messageformat/functions';

const msg = 'Today is {$today :datetime dateStyle=medium}';
const mf = new MessageFormat('en', msg, { functions: DraftFunctions });

mf.format({ today: new Date('2022-02-02') });
// 'Today is Feb 2, 2022'

The library also provides a number of other tools and utilities for MF2, such as:

  • MF2 data model conversion tools

    import { parseMessage, stringifyMessage } from 'messageformat';
  • MF2 data model validation and transformation tools

    import { validate, visit } from 'messageformat';
  • Concreate Syntax Tree (CST) tools for MF2

    import { parseCST, messageFromCST, stringifyCST } from 'messageformat/cst';
  • Utilities for building custom function handlers for MF2

    import {
      DraftFunctions,
      asPositiveInteger,
      asString
    } from 'messageformat/functions';

In addition to supporting MF2 syntax, compilers and formatting function runtimes are also provided for ICU MessageFormat and Fluent messages:

For more information on the types and functions provided by this package, see the documentation site.

[!IMPORTANT] The v4 release of the messageformat package has an entirely different API compared to its earlier major releases, which were built on top of ICU MessageFormat, aka "MF1". For that, please see @messageformat/core instead.