{"name":"@formatjs/intl-relativetimeformat","version":"4.4.3-alpha.6","description":"Formats JavaScript dates to relative time strings.","keywords":["intl","i18n","relative","time","moment","format","date"],"author":{"name":"Long Ho","email":"holevietlong@gmail.com"},"bugs":{"url":"https://github.com/formatjs/formatjs/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/formatjs/formatjs.git"},"devDependencies":{"@formatjs/intl-pluralrules":"^1.3.4-alpha.6+deb124d","formatjs-extract-cldr-data":"^9.9.4-alpha.6+deb124d"},"dependencies":{"@formatjs/intl-utils":"^1.4.1"},"main":"dist/index.js","module":"lib/index.js","types":"lib/intl-relativetimeformat.d.ts","scripts":{"build":"npm run cldr && npm run compile","cldr":"ts-node --project tsconfig.cjs.json scripts/cldr","clean":"rimraf dist lib dist-es6","compile":"tsc && api-extractor run --local && tsc -p tsconfig.cjs.json && tsc -p tsconfig.es6.json && 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 && cross-env NODE_ICU_DATA=../../node_modules/full-icu TS_NODE_PROJECT=tsconfig.cjs.json ts-node tests/runner"},"homepage":"https://github.com/formatjs/formatjs","license":"MIT","gitHead":"deb124d6bd86cf515b2be60fc9b4d4f0e9b9d907","readme":"# Intl RelativeTimeFormat\n\nA spec-compliant polyfill/ponyfill for Intl.RelativeTimeFormat fully tested by the [official ECMAScript Conformance test suite](https://github.com/tc39/test262)\n\n[![npm Version][npm-badge]][npm]\n![size](https://badgen.net/bundlephobia/minzip/@formatjs/intl-relativetimeformat)\n\n## Installation\n\n```\nnpm install @formatjs/intl-relativetimeformat\n```\n\n## Requirements\n\nThis package requires the following capabilities:\n\n1. [Intl.PluralRules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/PluralRules)\n\n**NOTE: `formatToParts` only works on Node 10+ due to lack of `Intl.NumberFormat.prototype.formatToParts` natively**\n\n## Usage\n\n### Ponyfill\n\nTo use the ponyfill, import it along with its data:\n\n```tsx\nimport IntlRelativeTimeFormat from '@formatjs/intl-relativetimeformat';\n// locale-data for zh\nIntlRelativeTimeFormat.__addLocaleData(\n  require('@formatjs/intl-relativetimeformat/dist/locale-data/zh.json')\n);\n\n// locale-data for zh\nIntlRelativeTimeFormat.__addLocaleData(\n  require('@formatjs/intl-relativetimeformat/dist/locale-data/en.json')\n);\n\nnew IntlRelativeTimeFormat('zh-CN').format(-1, 'second'); // '1秒钟前'\n```\n\n### Polyfill\n\nTo use the polyfill, just import it to make sure that a fully functional Intl.RelativeTimeFormat is available in your environment:\n\n```tsx\nimport '@formatjs/intl-relativetimeformat/polyfill';\nimport '@formatjs/intl-relativetimeformat/dist/locale-data/de'; // Add locale data for de\n```\n\nIf you want to polyfill all locales (e.g for Node):\n\n```tsx\nimport '@formatjs/intl-relativetimeformat/polyfill-locales';\n```\n\n## Tests\n\nThis library is fully [test262](https://github.com/tc39/test262/tree/master/test/intl402/RelativeTimeFormat)-compliant.\n\n## License\n\nThis software is free to use under the Yahoo! Inc. BSD license.\nSee the [LICENSE file][license] for license text and copyright information.\n\n[npm]: https://www.npmjs.org/package/@formatjs/intl-relativetimeformat\n[npm-badge]: https://img.shields.io/npm/v/@formatjs/intl-relativetimeformat.svg?style=flat-square\n","readmeFilename":"README.md","_id":"@formatjs/intl-relativetimeformat@4.4.3-alpha.6","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.18.4/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-sLIKS6/7Xd/c5JHCVbrepCiIqSL+uTJ35onVo7OWn4U8Hip5GFcJEH4UpcNkps5fScHMxBhgdPF+MjCyAAp3UA==","shasum":"538fba6011807197d01e9d39d6f552f6a5ea9c6a","tarball":"http://registry-npm.ywwl.com/@formatjs/intl-relativetimeformat/download/@formatjs/intl-relativetimeformat-4.4.3-alpha.6.tgz","fileCount":474,"unpackedSize":17852635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1hh1CRA9TVsSAnZWagAA9dMP/1EVR/fSu5cY+kyMHpuG\nNRVqY8GzI2CiTsAGQfiUyQh0zm7P4XkNyiaUzNbaX+r0gaX3Rtrh+NeR9VQ4\nTjt0YXD6hdfkN2lKEkZOduuFi1qOoqjGS5ad1HlTj2Zua3B/8FNNqsazbelc\nMVl6j1INdU0hB4sxcm5g7spl0df4fLcOXkrUe+UPS9PowKL1uIxOKmGlFMsc\nJ1KWobFIVOZiIrA3VHTxbr7KGeuWpBIL2NiJbegjhsLQIEFXh5ldTDG9/Exy\ncWnUiP6aQGiW+yWTTqoXIRW+g7sTIPO2MTunNR251VcxAlQHY9j8nJI1iviQ\nE+KsgX/ztLfI2uM+Pk9SiSnTJTQFOi0vdUvms5k/JuMemEQhc6f72pn0pRRt\nADqpnXsg/O1pDOupW7CBtjzFfUsqEaFl8jBrRq6vTX8IyB76w/aG2UMCEDA7\n4Oe4ihqttSoN9gqMhDxEx8TpI22wKykhNomw1jV0wAl3/kB/Ibcc8dWtNRTX\n4ShBNO515Y8z/Ex2JL66cEB4Sol68s/3HVST5y7ojEw6s2HZdLDCEXue+ZhK\nJ6UZL0z6LeHmeaG/80sNTNALcIN7VcV349sv2VmZo3xnnzgSWtOwl7ThVtws\nZ05QPoCWUUtcVGpuYpZ1nC0x1XFJLcYbnPj8FrSDk1GYWzSZzSUddxqL3yEu\n1Rto\r\n=U+jA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGZgkM53DRrgoE0XeJqPLZ5FhiNjR2Y7WIjRl+vhr83XAiEA1NiT4KGi7+GdxiVgs0fhcVmWCyu2u+32qUyCYpoewxs="}],"size":1273026,"noattachment":false,"key":"/@formatjs/intl-relativetimeformat/-/@formatjs/intl-relativetimeformat-4.4.3-alpha.6.tgz"},"maintainers":[{"email":"holevietlong@gmail.com","name":"longlho"},{"email":"seth@bertalotto.net","name":"redonkulus"}],"_npmUser":{"name":"longlho","email":"holevietlong@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/intl-relativetimeformat_4.4.3-alpha.6_1574312053297_0.293777702952831"},"_hasShrinkwrap":false,"publish_time":1574312053506,"_cnpm_publish_time":1574312053506,"dist-tags":{"latest":"13.0.1","next":"6.0.4-alpha.0"}}