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

currency-to-locale

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

currency-to-locale

Converts currency codes to locale identifiers following format specified in IETF BCP 47 standard

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
391
Maintainers
0
Weekly downloads
 
Created
Source

currency-to-locale

****************
DESCRIPTION
****************

Converts currency codes to locale identifiers following format specified in IETF BCP 47 standard, comprised of two-letter ISO 639-1 language code and ISO 3166-1 alpha-2 country code.
Currency codes initially compiled using Frankfurter's https://api.frankfurter.app/currencies. Additional currency code and locale id additions welcome.
For currency codes with multiple locales/languages, defaults have been selected.


currencyToLocale function takes two arguments: currency code (required) and language code (optional)
invalid input types converted to strings
currency codes converted to uppercase; language codes converted to lowercase
support for currency codes with multiple locales, e.g. EUR, using language codes to differentiate

*****************
INSTALLATION
*****************

npm install currency-to-locale


*******************
USAGE EXAMPLES
*******************

To see examples of how to use the currencyToLocale function, run the following command:
```bash node examples/examples.js

Keywords

FAQs

Package last updated on 17 Nov 2024

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