{"_id":"messageformat@4.1.0","bugs":{"url":"https://github.com/messageformat/messageformat/issues"},"dist":{"shasum":"91225a33f41eb18954f43ccd15cb793dd73ed078","tarball":"http://registry-npm.ywwl.com/messageformat/download/messageformat-4.1.0.tgz","fileCount":85,"integrity":"sha512-ZLId0BYfsNhC6/MRwVFw1yTLgG9cbJwfTsjYSS2C59PdfJWVRsX7hthADvsXefBtTg2FKso0VAJmMJJOtnJ75w==","signatures":[{"sig":"MEUCIHKxnFtEApiPIH968EA2bQ6HcQO1Y9r0ga1aoJzdqV23AiEAmDtLroRGa+329z4Y3+7GBmt8h5PijDvhNyb4ng3B+zM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBpZIR4T0oTOso4gIdLZzVL3tAPziHAnPo27KPrZkNgbAiBT3HbPdLn+Ijt9ZnndJvnIgI6Cm7z9BdDSdlhlsfeIiQ=="}],"unpackedSize":172093,"size":40024,"noattachment":false,"key":"/messageformat/-/messageformat-4.1.0.tgz"},"main":"lib/index.js","name":"messageformat","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":"439fb0cae45ba113bcbad4949e61e9c3e1c697ff","license":"Apache-2.0","scripts":{"build":"tsc --project tsconfig.build.json"},"version":"4.1.0","_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"homepage":"http://messageformat.github.io/messageformat/","keywords":["messageformat","unicode","polyfill","internationalization","i18n","localization","l10n"],"repository":{"url":"git+https://github.com/messageformat/messageformat.git","type":"git","directory":"mf2/messageformat"},"_npmVersion":"12.2.0","description":"Intl.MessageFormat / Unicode MessageFormat 2 parser, runtime and polyfill","directories":{},"maintainers":[{"name":"slexaxton","email":"alexsexton@gmail.com"},{"name":"eemeli","email":"eemeli@gmail.com"}],"_nodeVersion":"26.0.0","contributors":[{"name":"Eemeli Aro","email":"eemeli@gmail.com"}],"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/messageformat_4.1.0_1791803134346_0.2452411091783615"},"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":1791803134455,"_cnpm_publish_time":1791803134455,"dist-tags":{"latest":"4.1.0"}}