A PEG.js-based parser for ICU MessageFormat strings, used by the messageformat library to parse ICU message patterns into an AST. Current stable version is 4.1.3, with a release cadence aligned with the messageformat monorepo. Key differentiators: implements the ICUMessageFormat specification, supports plural, select, and complex patterns, and is the heritage parser before the shift to MF2 in messageformat v4. It is lightweight and focused solely on parsing.
npm install messageformat-parserVerified import paths — ran on the pinned version, not inferred.
Illustrates parsing an ICU MessageFormat string with plural arguments using messageformat-parser.
Use messageformat (the full package) for MF2 support, or continue using messageformat-parser for ICU MessageFormat.
Use messageformat or another library to format the AST into a string.
Update your code to use the new AST shape: 'type' property is string, not a number.
Run 'npm install messageformat-parser' and ensure it's in your dependencies.
Check message format specification and escape single quotes with ''.
Use import { parse } from 'messageformat-parser' instead of importing default.No dependency data recorded yet.