{"analyzedAt":"2022-07-14T16:29:46.522Z","collected":{"metadata":{"name":"@brixtol/currency-placements","scope":"brixtol","version":"1.2.0","description":"Mappings for Currency Symbol placements using currency.js patterns","keywords":["currency","mappings","country","3166-1 alpha-2","ISO 4217"],"date":"2021-10-24T22:03:38.977Z","author":{"name":"Νίκος Σαβίδης","email":"n@brixtol.com","url":"https://github.com/brixtol/currency-symbol-placements"},"publisher":{"username":"sissel","email":"nicos.savidis@gmail.com"},"maintainers":[{"username":"sissel","email":"nicos.savidis@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/brixtol/currency-symbol-placements.git"},"links":{"npm":"https://www.npmjs.com/package/%40brixtol%2Fcurrency-placements","homepage":"https://github.com/brixtol/currency-symbol-placements#readme","repository":"https://github.com/brixtol/currency-symbol-placements","bugs":"https://github.com/brixtol/currency-symbol-placements"},"license":"MIT","dependencies":{"@brixtol/currency-codes":"^1.2.1","@brixtol/tsutils":"^1.4.1"},"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"},"releases":[{"from":"2022-06-14T00:00:00.000Z","to":"2022-07-14T00:00:00.000Z","count":0},{"from":"2022-04-15T00:00:00.000Z","to":"2022-07-14T00:00:00.000Z","count":0},{"from":"2022-01-15T00:00:00.000Z","to":"2022-07-14T00:00:00.000Z","count":1},{"from":"2021-07-14T00:00:00.000Z","to":"2022-07-14T00:00:00.000Z","count":3},{"from":"2020-07-14T00:00:00.000Z","to":"2022-07-14T00:00:00.000Z","count":3}],"hasTestScript":true,"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!"},"npm":{"downloads":[{"from":"2022-07-13T00:00:00.000Z","to":"2022-07-14T00:00:00.000Z","count":1},{"from":"2022-07-07T00:00:00.000Z","to":"2022-07-14T00:00:00.000Z","count":3},{"from":"2022-06-14T00:00:00.000Z","to":"2022-07-14T00:00:00.000Z","count":11},{"from":"2022-04-15T00:00:00.000Z","to":"2022-07-14T00:00:00.000Z","count":31},{"from":"2022-01-15T00:00:00.000Z","to":"2022-07-14T00:00:00.000Z","count":62},{"from":"2021-07-14T00:00:00.000Z","to":"2022-07-14T00:00:00.000Z","count":116}],"starsCount":0},"github":{"starsCount":1,"forksCount":0,"subscribersCount":2,"issues":{"count":0,"openCount":0,"distribution":{"3600":0,"10800":0,"32400":0,"97200":0,"291600":0,"874800":0,"2624400":0,"7873200":0,"23619600":0,"70858800":0,"212576400":0},"isDisabled":false},"contributors":[{"username":"panoply","commitsCount":21}],"commits":[{"from":"2022-07-07T00:00:00.000Z","to":"2022-07-14T00:00:00.000Z","count":0},{"from":"2022-06-14T00:00:00.000Z","to":"2022-07-14T00:00:00.000Z","count":0},{"from":"2022-04-15T00:00:00.000Z","to":"2022-07-14T00:00:00.000Z","count":0},{"from":"2022-01-15T00:00:00.000Z","to":"2022-07-14T00:00:00.000Z","count":0},{"from":"2021-07-14T00:00:00.000Z","to":"2022-07-14T00:00:00.000Z","count":13}]},"source":{"files":{"readmeSize":2525,"testsSize":848,"hasNpmIgnore":true,"hasChangelog":true},"linters":["eslint","prettier"]}},"evaluation":{"quality":{"carefulness":0.9999999999999999,"tests":0.6,"health":1,"branding":0},"popularity":{"communityInterest":4,"downloadsCount":10.333333333333334,"downloadsAcceleration":0.01887366818873666,"dependentsCount":0},"maintenance":{"releasesFrequency":0.9,"commitsFrequency":0.9,"openIssues":0.9,"issuesDistribution":0.9}},"score":{"final":0.6144256339594381,"detail":{"quality":0.8464094502755721,"popularity":0.030123838832449564,"maintenance":0.999884157958312}}}