{"name":"messageformat","version":"4.0.0-9","description":"Intl.MessageFormat / Unicode MessageFormat 2 parser, runtime and polyfill","keywords":["messageformat","unicode","polyfill","internationalization","i18n","localization","l10n"],"contributors":[{"name":"Eemeli Aro","email":"eemeli@gmail.com"}],"license":"Apache-2.0","homepage":"http://messageformat.github.io/messageformat/","repository":{"type":"git","url":"git+https://github.com/messageformat/messageformat.git","directory":"packages/mf2-messageformat"},"main":"lib/index.js","exports":{".":{"default":"./lib/index.js"},"./functions":{"default":"./lib/functions/index.js"},"./functions/utils":{"default":"./lib/functions/utils.js"},"./package.json":"./package.json"},"scripts":{"build":"tsc --project tsconfig.build.json","extract-api":"api-extractor run --local --verbose"},"_id":"messageformat@4.0.0-9","readmeFilename":"README.md","gitHead":"4893b0bf3887865bb9fa231113c1467bd2334ec6","types":"./lib/index.d.ts","bugs":{"url":"https://github.com/messageformat/messageformat/issues"},"_nodeVersion":"22.8.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-4QHEgN5EiK0w8XmMztn+hdnuJuaChp0bv6D1iw1GvFMR9FVDF9sDk0KfIM9XnBjqa0ekK8wBsX7lyMNfD53dqQ==","shasum":"c8e49b6059ee561a9be8b01b85f0366adb0f851f","tarball":"http://registry-npm.ywwl.com/messageformat/download/messageformat-4.0.0-9.tgz","fileCount":81,"unpackedSize":161186,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC56zXhTETf5UhJx4cZy2tqFvosfrTUeUIlCwSlGnco9wIgMAw7VBJMDmkiBTlHAmdyhGe6pfh6K7PCd31ffJe6enQ="}],"size":37496,"noattachment":false,"key":"/messageformat/-/messageformat-4.0.0-9.tgz"},"_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messageformat_4.0.0-9_1732185663440_0.04861941591542007"},"_hasShrinkwrap":false,"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":1732185663595,"maintainers":[{"name":"slexaxton","email":"alexsexton@gmail.com"},{"name":"eemeli","email":"eemeli@gmail.com"}],"_cnpm_publish_time":1732185663595,"dist-tags":{"latest":"4.1.0"}}