Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

locale-currency

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

locale-currency

A map of i18n country codes to ISO 4217 currency codes. Originally generated from the output of java.util.Currency.getInstance(locale)

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
62K
decreased by-18.38%
Maintainers
1
Weekly downloads
 
Created
Source

locale-currency

A map of i18n country codes to ISO 4217 currency codes.

Examples

var LocaleCurrency = require('locale-currency');
var assert = require('assert');
assert(LocaleCurrency.getCurrency("us") === "USD");
assert(LocaleCurrency.getCurrency("US") === "USD");
assert(LocaleCurrency.getCurrency("Us") === "USD");
assert(LocaleCurrency.getCurrency("uS") === "USD");
assert(LocaleCurrency.getCurrency("EN_US") === "USD");
assert(LocaleCurrency.getCurrency("en_us") === "USD");
assert(LocaleCurrency.getCurrency("EN-US") === "USD");
assert(LocaleCurrency.getCurrency("en-us") === "USD");
assert(LocaleCurrency.getCurrency("GB") === "GBP");
assert(LocaleCurrency.getCurrency("ES") === "EUR");
assert(LocaleCurrency.getCurrency("GR") === "EUR");


var euroCountries = LocaleCurrency.getLocales("EUR");
assert(euroCountries.indexOf("GR") > -1); // Germany
assert(euroCountries.indexOf("FR") > -1); // France
assert(euroCountries.indexOf("ES") > -1); // Spain

FAQs

Package last updated on 12 Nov 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc