{"name":"messageformat","version":"4.0.0","keywords":["messageformat","unicode","polyfill","internationalization","i18n","localization","l10n"],"license":"Apache-2.0","_id":"messageformat@4.0.0","maintainers":[{"name":"slexaxton","email":"alexsexton@gmail.com"},{"name":"eemeli","email":"eemeli@gmail.com"}],"contributors":[{"name":"Eemeli Aro","email":"eemeli@gmail.com"}],"homepage":"http://messageformat.github.io/messageformat/","bugs":{"url":"https://github.com/messageformat/messageformat/issues"},"dist":{"shasum":"93e78d70a4e66cb67ff4c5ad42d3e6152c43f87a","tarball":"http://registry-npm.ywwl.com/messageformat/download/messageformat-4.0.0.tgz","fileCount":85,"integrity":"sha512-XKmJ/ffTWToWOlHJzt85ZChQgVGC0LHzNWuNK8zuYpNySsB0nIEmytOdSAOW9ETKtkajAUJf520m5gFHHnrTYg==","signatures":[{"sig":"MEUCIBjKb97Lg/ggXQeFkATKUSnMQdabiZ5JDHpjL9lH7GdlAiEAqu6PahRAnQGvkOLpF1udxppK5tu156pjFv0WVhCG4Tg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":172022,"size":40026,"noattachment":false,"key":"/messageformat/-/messageformat-4.0.0.tgz"},"main":"lib/index.js","type":"module","types":"./lib/index.d.ts","engines":{"node":"^20.19 || ^22.12 || >=24"},"exports":{".":"./lib/index.js","./cst":"./lib/cst/index.js","./functions":"./lib/functions/index.js","./package.json":"./package.json"},"gitHead":"d3eba5c86085080601a0fe64933feb47c16c240a","scripts":{"build":"tsc --project tsconfig.build.json"},"_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"repository":{"url":"git+https://github.com/messageformat/messageformat.git","type":"git","directory":"packages/mf2-messageformat"},"_npmVersion":"11.6.2","description":"Intl.MessageFormat / Unicode MessageFormat 2 parser, runtime and polyfill","directories":{},"_nodeVersion":"25.2.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/messageformat_4.0.0_1764054571085_0.4288589523358226","host":"s3://npm-registry-packages-npm-production"},"readme":"This library provides a formatter and other tools for [Unicode MessageFormat 2.0] (MF2),\nthe new standard for localization developed by the [MessageFormat Working Group].\n\nThis includes a formatter that can be used as a polyfill for\nthe proposed [ECMA-402 Intl.MessageFormat] formatter.\n\nThe API provided by this library is current as of the [LDML 48.2][ldml] (March 2026)\nversion of the Unicode MessageFormat specification.\n\n[unicode messageformat 2.0]: https://unicode.org/reports/tr35/tr35-messageFormat.html\n[messageformat working group]: https://github.com/unicode-org/message-format-wg\n[ecma-402 intl.messageformat ]: https://github.com/tc39/proposal-intl-messageformat/\n[ldml]: https://www.unicode.org/reports/tr35/tr35-78/tr35-messageFormat.html\n\n```sh\nnpm install --save messageformat\n```\n\n```js\nimport { MessageFormat } from 'messageformat';\nimport { DraftFunctions } from 'messageformat/functions';\n\nconst msg = 'Today is {$today :datetime dateStyle=medium}';\nconst mf = new MessageFormat('en', msg, { functions: DraftFunctions });\n\nmf.format({ today: new Date('2022-02-02') });\n// 'Today is Feb 2, 2022'\n```\n\nThe library also provides a number of other tools and utilities for MF2, such as:\n\n- MF2 data model conversion tools\n\n  ```js\n  import { parseMessage, stringifyMessage } from 'messageformat';\n  ```\n\n- MF2 data model validation and transformation tools\n\n  ```js\n  import { validate, visit } from 'messageformat';\n  ```\n\n- Concreate Syntax Tree (CST) tools for MF2\n\n  ```js\n  import { parseCST, messageFromCST, stringifyCST } from 'messageformat/cst';\n  ```\n\n- Utilities for building custom function handlers for MF2\n\n  ```js\n  import {\n    DraftFunctions,\n    asPositiveInteger,\n    asString\n  } from 'messageformat/functions';\n  ```\n\nIn addition to supporting MF2 syntax,\ncompilers and formatting function runtimes are also provided for\nICU MessageFormat and Fluent messages:\n\n- [@messageformat/icu-messageformat-1](https://www.npmjs.com/package/@messageformat/icu-messageformat-1)\n- [@messageformat/fluent](https://www.npmjs.com/package/@messageformat/fluent)\n\nFor more information on the types and functions provided by this package,\nsee the [documentation site](https://messageformat.github.io/).\n\n> [!IMPORTANT]\n> The v4 release of the `messageformat` package has\n> an entirely different API compared to its earlier major releases,\n> which were built on top of ICU MessageFormat, aka \"MF1\".\n> For that,\n> please see [`@messageformat/core`](https://www.npmjs.com/package/@messageformat/core) instead.\n","publish_time":1764054571288,"_cnpm_publish_time":1764054571288,"dist-tags":{"latest":"4.1.0"}}