{"_id":"@brixtol/currency-placements","_rev":"2-ddc74b843b1d5659821636914ffe5690","name":"@brixtol/currency-placements","dist-tags":{"latest":"1.2.0"},"versions":{"1.2.0":{"name":"@brixtol/currency-placements","version":"1.2.0","description":"Mappings for Currency Symbol placements using currency.js patterns","author":{"name":"Νίκος Σαβίδης","email":"n@brixtol.com","url":"https://github.com/brixtol/currency-symbol-placements"},"license":"MIT","main":"./package/index.js","exports":{"require":"./package/index.js","import":"./package/index.es.js"},"types":"./package/index.d.ts","keywords":["currency","mappings","country","3166-1 alpha-2","ISO 4217"],"repository":{"type":"git","url":"git+https://github.com/brixtol/currency-symbol-placements.git"},"bugs":{"url":"https://github.com/brixtol/currency-symbol-placements"},"engines":{"pnpm":">=5"},"ava":{"require":["esm"],"files":["test/*.js"],"concurrency":5},"devDependencies":{"@brixtol/rollup-config":"^1.4.0","@brixtol/tsconfig":"^1.0.0","currency.js":"^2.0.4","esm":"^3.2.25","typescript":"^4.3.5"},"scripts":{"dev":"rollup -c -w","build":"rollup -c --environment prod","test":"ava --watch --verbose"},"_resolved":"","_integrity":"","_from":"file:brixtol-currency-placements-1.2.0.tgz","homepage":"https://github.com/brixtol/currency-symbol-placements#readme","_id":"@brixtol/currency-placements@1.2.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-xZY+Ax+xmdmGN6viBt1TKoxpiiZ9pxaEqLVhzB8DsFcx+Y8HZMzYdGrisR4/eax42yxSymGWD2qzeZXsqauZ2Q==","shasum":"060032b50fb4d4d9955d8ae9733646658bc4c452","tarball":"https://registry.npmjs.org/@brixtol/currency-placements/-/currency-placements-1.2.0.tgz","fileCount":11,"unpackedSize":20113,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzaGNCRA9TVsSAnZWagAAYTUP/RkrHpPT47SbzPRylPy8\npm2rU36kYTSWeAVVK3+gQKC/KHi2oCDXDN24KG9avB2O3LLFIIZdhplqx5me\nfn/IKaK4pRhRcYj5ZelqTpFobHV7H8LoNtmfAZnxG736sv8c/ftJEWZrzKjH\n87TALB/hd/q6iHNaf6AesCNcsyePT69VVjv69dsqZaTg33jKe6EnLZ8rWIMG\nEO7XZA/+YFj75n1My6JjuHMwTyM3u2LKOlq0KTmVqfM3ATtpFNVTodIZKFHd\nD7CC82cje0F2yR70HhKRLowL2P8WTmJgRlJGtPeYueY7RsbZ9mCT0ZPe2Jvz\nEZJnb3KaKnve48BvlaI54n4tB8IJ4WbvOcULqG5CQn4CAZCmFtVqlkzsdptD\nExD/Qy6jffiUXKztb7iT0O4KjIwfa62/Pz/y/3RkUM2wdT+EfGv1fSTpb55h\njO3u6IC5dpXb/V7FL+sqv3k9vOogP0IeBcVaPdMIvIY04h4S01PLFMMzOEgr\nyyzBqgXSA/wEfvrRcCtsfmhgRyuNFl8D3eRCw6Aji+gzw/qYVg6LCedgf+7E\n41/ha6OJqLs/WoB/lixFqGAWrZOoeydQX3hfgVjO9cda0zRAtyG3wwN1EgoZ\nXgbWqqPmckrlhJCVDPjkA7f4/m6BAzK7zB+l9DWbP54Nak5fsfHDkE5gS7Y3\nLtYm\r\n=dzu1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyCFLnyd3D7FPJaf2A9V+E9mIVSyDlr+Nn4QqsuQAJjgIgIfB/fIxfgggkmBvYZZfDpXtkXWAZ2jC9Jy1TSmBgbI0="}]},"_npmUser":{"name":"sissel","email":"nicos.savidis@gmail.com"},"directories":{},"maintainers":[{"name":"sissel","email":"nicos.savidis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/currency-placements_1.2.0_1635113018819_0.8634316930690893"},"_hasShrinkwrap":false}},"time":{"created":"2021-10-24T22:03:38.771Z","1.2.0":"2021-10-24T22:03:38.977Z","modified":"2022-04-04T20:43:54.255Z"},"maintainers":[{"name":"sissel","email":"nicos.savidis@gmail.com"}],"description":"Mappings for Currency Symbol placements using currency.js patterns","homepage":"https://github.com/brixtol/currency-symbol-placements#readme","keywords":["currency","mappings","country","3166-1 alpha-2","ISO 4217"],"repository":{"type":"git","url":"git+https://github.com/brixtol/currency-symbol-placements.git"},"author":{"name":"Νίκος Σαβίδης","email":"n@brixtol.com","url":"https://github.com/brixtol/currency-symbol-placements"},"bugs":{"url":"https://github.com/brixtol/currency-symbol-placements"},"license":"MIT","readme":"## @brixtol/currency-placements\n\nCurrency Symbol placements for [currency.js](https://github.com/scurker/currency.js). Mappings use ([ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)) 3 letter currency codes and return the format pattern (`!#`) used by _currency.js_ where `!` is the currency symbol and `#` the amount.\n\nThis package is used by the [Brixtol Textiles](https://www.brixtoltextiles.com) internal API when dealing with currency conversion and presentation locales pertaining to i18n logics and has been open sourced from our [pnpm](https://pnpm.js.org/en/cli/install) monorepo workspace.\n\n### Why?\n\nWe found the the vast majority of U.S commerce SaaS services were constantly getting currency symbol placements wrong. We use [currency.js](https://github.com/scurker/currency.js) to convert currencies in our [mithril.js](https://mithril.js.org/) applications and this package provides us with a wrapper for getting placements correct.\n\n### Install\n\n[pnpm](https://pnpm.js.org/en/cli/install)\n\n```cli\npnpm i @brixtol/currency-symbol-placements\n```\n\n[npm](https://www.npmjs.com/)\n\n```cli\nnpm install @brixtol/currency-symbol-placements\n```\n\n[Yarn](https://yarnpkg.com/)\n\n```cli\nyarn add @brixtol/currency-symbol-placements\n```\n\n### Usage\n\nPass in a currency code that is lowercase, uppercase or a mixture of both and the pattern replacement string is returned.\n\n```javascript\nimport currency from 'currency.js';\nimport { getPlacement } from '@brixtol/currency-symbols-placements';\n\n// Currency code SEK (Swedish Krona) - Kr\nconst SEK = getPlacement('SEK'); // # !\n\n// Currency code EUR (Euros) - €\nconst EUR = getPlacement('eur'); // !#\n\n// Using with currency.js\ncurrency('510.00', {\n  separator: '.',\n  decimal: ',',\n  fromCents: true,\n  pattern: SEK // returning \"# !\" > \"510.00 kr\"\n}).format();\n\n// ....\n```\n\n### Related\n\nLocale related mappings helpers:\n\n- [@brixtol/currency-symbols](https://github.com/brixtol/currency-symbols)\n\nCountry code to currency code mappings:\n\n- [@brixtol/currency-codes](https://github.com/brixtol/currency-codes)\n\n### Contributing\n\nContributions are welcome! Currency symbol placements are a real mixed bag and generally do not adhere to official specifications on the matter. If the mapping placements are not accurate, please submit a PR with some foundations.\n\n> See the `package.json` for scripts and make sure you are using pnpm, because pnpm is dope and does dope shit.\n\n### License\n\nLicensed under [MIT](#LICENCE)\n\n---\n\nWe [♡](https://www.brixtoltextiles.com/discount/4D3V3L0P3RS]) open source!\n","readmeFilename":"readme.md"}