Socket
Socket
Sign inDemoInstall

currency-map-country

Package Overview
Dependencies
1
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    currency-map-country

Mapping of countries and their primary currency.


Version published
Weekly downloads
344
decreased by-11.57%
Maintainers
1
Install size
579 kB
Created
Weekly downloads
 

Readme

Source

currency-map-country

Build Status Known Vulnerabilities PRs Welcome

Mapping of countries and their primary currency along with currency data.

Installation

npm install currency-map-country

Test

Simple test
npm run test
Test with watch
npm run test:watch 
Test coverage
npm run test:coverage  

Usage

Get country data from country name

import { getCountry } from 'currency-map-country';
getCountry('USA'); //=> { abbreviation: 'US', currency: 'USD' }
getCountry('Canada'); //=> { abbreviation: 'CA', currency: 'CAD' }

Get currency data from currency abbreviation

import { getCurrency } from 'currency-map-country';
getCurrency('USD'); //=> { name: 'U.S. Dollar (USD)', symbolFormat: '${#}' }
getCurrency('CAD'); //=> { name: 'Canadian Dollar (CAD)', symbolFormat: 'C${#}' }

Get currency abbreviation from a country name

import { getCurrencyAbbreviation } from 'currency-map-country';
getCurrencyAbbreviation('UK'); //=> 'GBP'
getCurrencyAbbreviation('Canada'); //=> 'CAD'

Get country from abbreviation

import { getCountryByAbbreviation } from 'currency-map-country';
getCountryByAbbreviation('UK'); //=> 'UK'
getCurrencyAbbreviation('US'); //=> 'USA'

Get Currency List

import { getCurrencyList } from 'currency-map-country';
getCurrencyList(); //=> [ { abbr: "AFA", name: "Afghanistan Afghani (AFA)", symbolFormat: "AFA {#}" }, { abbr: "ALL", name: "Albanian Lek (ALL)", symbolFormat:, "ALL {#}" }, ... ]

Get Currency Abbreviation From Name

import { getCurrencyAbbreviationFromName } from 'currency-map-country';
getCurrencyAbbreviationFromName('U.S. Dollar (USD)'); //=> 'USD'

Keywords

FAQs

Last updated on 15 Dec 2017

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc