{"name":"@formatjs/intl-unified-numberformat","version":"2.1.4-alpha.7","description":"Ponyfill for intl unified numberformat proposal","keywords":["polyfill","i18n","numberformat","unified"],"author":{"name":"Long Ho","email":"holevietlong@gmail.com"},"homepage":"https://github.com/formatjs/formatjs","license":"MIT","main":"dist/index.js","module":"lib/index.js","types":"lib/intl-unified-numberformat.d.ts","repository":{"type":"git","url":"git+https://github.com/formatjs/formatjs.git"},"devDependencies":{"@formatjs/intl-pluralrules":"^1.3.4-alpha.7+243a67e","formatjs-extract-cldr-data":"^9.9.3"},"dependencies":{"@formatjs/intl-utils":"^1.4.1"},"scripts":{"build":"npm run cldr && npm run compile","cldr":"ts-node --project tsconfig.cjs.json scripts/cldr","clean":"rimraf dist lib","compile":"tsc && tsc -p tsconfig.cjs.json && api-extractor run --local && rollup -c rollup.config.js","jest":"cross-env NODE_ICU_DATA=../../node_modules/full-icu TS_NODE_PROJECT=tsconfig.cjs.json cross-env NODE_ENV=test jest","test":"npm run jest"},"bugs":{"url":"https://github.com/formatjs/formatjs/issues"},"gitHead":"243a67e101a0ea31cb40a8142bbccc7838938f41","readme":"# `intl-unified-numberformat`\n\nA ponyfill/polyfill for [`intl-unified-numberformat`](https://github.com/tc39/proposal-unified-intl-numberformat). This wraps `Intl.NumberFormat` and has the exact same APIs.\n\n## Installation\n\n```\nnpm install @formatjs/intl-unified-numberformat\n```\n\n## Requirements\n\nThis package requires the following capabilities:\n\n- [Intl.PluralRules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/PluralRules)\n\n# Features\n\n1. `unit`, `unitDisplay`, `style: unit` and sanctioned units are supported\n\n## Caveats\n\n1. `formatToParts` does not include the `unit` part yet.\n\n# Usage\n\nTo use the ponyfill, import it along with its data:\n\n```tsx\nimport {UnifiedNumberFormat} from '@formatjs/intl-unified-numberformat';\nUnifiedNumberFormat.__addLocaleData(\n  require('@formatjs/intl-unified-numberformat/dist/locale-data/zh.json') // locale-data for zh\n);\nUnifiedNumberFormat.__addLocaleData(\n  require('@formatjs/intl-unified-numberformat/dist/locale-data/en.json') // locale-data for en\n);\n\nnew UnifiedNumberFormat('zh', {\n  style: 'unit',\n  unit: 'bit',\n  unitDisplay: 'long',\n}).format(1000); // 1,000比特\n```\n\nTo use this as a polyfill, override `Intl.NumberFormat` as below:\n\n```tsx\nimport '@formatjs/intl-unified-numberformat/polyfill';\nif (typeof Intl.NumberFormat.__addUnitLocaleData === 'function') {\n  Intl.NumberFormat.__addUnitLocaleData(\n    require('@formatjs/intl-unified-numberformat/dist/locale-data/zh.json') // locale-data for zh\n  );\n  Intl.NumberFormat.__addUnitLocaleData(\n    require('@formatjs/intl-unified-numberformat/dist/locale-data/en.json') // locale-data for en\n  );\n}\n\nnew Intl.NumberFormat('zh', {\n  style: 'unit',\n  unit: 'bit',\n  unitDisplay: 'long',\n}).format(1000); // 1,000比特\n```\n\n## Supported Units\n\nCurrently [intl-unified-numberformat](https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_diff_out.html#sec-issanctionedsimpleunitidentifier) has a list of sanctioned units as below\n\n```tsx\ntype Unit =\n  | 'acre'\n  | 'bit'\n  | 'byte'\n  | 'celsius'\n  | 'centimeter'\n  | 'day'\n  | 'degree'\n  | 'fahrenheit'\n  | 'fluid-ounce'\n  | 'foot'\n  | 'gallon'\n  | 'gigabit'\n  | 'gigabyte'\n  | 'gram'\n  | 'hectare'\n  | 'hour'\n  | 'inch'\n  | 'kilobit'\n  | 'kilobyte'\n  | 'kilogram'\n  | 'kilometer'\n  | 'liter'\n  | 'megabit'\n  | 'megabyte'\n  | 'meter'\n  | 'mile'\n  | 'mile-scandinavian'\n  | 'millimeter'\n  | 'milliliter'\n  | 'millisecond'\n  | 'minute'\n  | 'month'\n  | 'ounce'\n  | 'percent'\n  | 'petabyte'\n  | 'pound'\n  | 'second'\n  | 'stone'\n  | 'terabit'\n  | 'terabyte'\n  | 'week'\n  | 'yard'\n  | 'year';\n```\n","readmeFilename":"README.md","_id":"@formatjs/intl-unified-numberformat@2.1.4-alpha.7","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.18.4/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-r7N349iQlyd45HrtGcPNVX3RHWYAEl31tLygmHypHCDdFMjwgPzMoi/OsTyKMBy+BVVzU9Y7vqjHFAfzkwUQfg==","shasum":"f55b3a4382bd57f9df2cd1fa92518d70a71d5cee","tarball":"http://registry-npm.ywwl.com/@formatjs/intl-unified-numberformat/download/@formatjs/intl-unified-numberformat-2.1.4-alpha.7.tgz","fileCount":451,"unpackedSize":15924381,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1h8iCRA9TVsSAnZWagAABWEP/if1B9ZYQSLbY7qHcUc2\n1xctRte4bwPlghFcxajV85Nhw1Q5M2AT5z5U/6ldsEeivAmLP5M2VhvgCsso\naRzxR/3+tofN4Pl2q+AcEuUBknH1Idsogri5AP+BG7jA8UAHEA8DIm+6RTql\nftpLlfNUiu+9l9CJafSRiQgo0JzjB07Sj7UZ2B4rpFIkYnxOr0cRE1BSn+fx\n8evZrphjN2zVmnc3taFERfGpZ1J4phIni/Uq09eS2Z6tnYqQP9olid6RyB+2\nYv/KYmKPEZlHc7mRR8yEalT0e7ZKMTySTxCwd5doN937mvPc0bJMVMGeT9wn\nRg+CrxQrEXZrCB5xIBnAwPTg9T5FVOfdmkOXJC4AfSjGEc3j+0WuIt95YVlp\nyVps8T5VSq/LyuYu36DV6EuRCkyaKtzw9PuKLGumkCN+7CnrCB4s245kNOig\n3OKTHKVbMQ5MLAnIj8exQGcFnKu3iJQAvHA4NocWPxXfFMJh3nEFQuhTlLlj\nbfSfPhsQtMEiDOyHwVinxprJ1zbwZZddLEHw4VWrHsyGIcTD8zf/p6nI79bT\nsW+iCCwz+Iuuu6iSA38+ZuCmw289HwOxywiA0GBOcseKsaAQrFumB7LTzRjl\nt+j/WJ5+QfXHd78l5g8V66mMjX65H47tCPERkW9OKbw+Uxjb2pN5AGalZdWo\nOteA\r\n=6DVF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAE15evuEFCS12JQ3lwkHeAIJThQozRp33HXp9Yxz5kbAiEAxM85SpxGUjhNTfZxRcoKkjLSn4Wkxo7yPP+616WpDA8="}],"size":1150184,"noattachment":false,"key":"/@formatjs/intl-unified-numberformat/-/@formatjs/intl-unified-numberformat-2.1.4-alpha.7.tgz"},"maintainers":[{"name":"longlho","email":"holevietlong@gmail.com"},{"name":"redonkulus","email":"seth@bertalotto.net"}],"_npmUser":{"name":"longlho","email":"holevietlong@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/intl-unified-numberformat_2.1.4-alpha.7_1574313761597_0.8052155400995824"},"_hasShrinkwrap":false,"publish_time":1574313761835,"_cnpm_publish_time":1574313761835,"dist-tags":{"latest":"3.3.7","next":"2.1.4-alpha.7"}}