Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@brixtol/currency-codes
Advanced tools
Mappings for 2 letter (Alpha 2) country codes to 3 letter currency code.
Country codes (3166-1 alpha-2) to Currency (ISO 4217) code mappings used by the Brixtol Textiles internal API when dealing with pricing and currency conversions. Supports all 249 countries to currency maps.
Minified: 2.23 KB
Gzipped: 1.08 KB
pnpm i @brixtol/currency-codes
Because pnpm is dope and does dope shit.
npm install @brixtol/currency-codes
yarn add @brixtol/currency-codes
You can pass in a country code that is lowercase, uppercase or a mixture of both.
import { getCurrency } from "@brixtol/currency-codes";
// Country code SE (Sweden)
const sek = getCurrency("SE"); // SEK
// Country code NL (Netherlands)
const eur = getCurrency("nl"); // EUR
// Country code US (United States)
const eur = getCurrency("uS"); // USD
// ....
The module also exposes the raw mappings and interface on the export. The mappings object is provided read only using Object.freeze. The raw mappings are annotated with JSDoc comments so when using an editor that supports intellisense (ie: vscode) you will receive the country and currency name in completions and hovers.
import { Currencies, ICurrencies } from "@brixtol/currency-codes";
// Mapping Object
Currencies.SE; // SEK
Currencies.NL; // EUR
Currencies.RU; // RUB
// Interface
ICurrencies.SE; // SEK
ICurrencies.NL; // EUR
ICurrencies.RU; // RUB
The interface is identical to the mapping.
Currency code to currency symbol mappings:
Country code to country name mappings:
Currency code to currency.js symbol placement mappings:
Licensed under MIT
We ♡ open source!
1.2.0 - 21/10/2021
FAQs
Mappings for 2 letter (Alpha 2) country codes to 3 letter currency code.
The npm package @brixtol/currency-codes receives a total of 42 weekly downloads. As such, @brixtol/currency-codes popularity was classified as not popular.
We found that @brixtol/currency-codes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.