New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

currency-map-country

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

currency-map-country

Mapping of countries and their primary currency.

1.0.12
latest
Source
npm
Version published
Maintainers
1
Created
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

countries

FAQs

Package last updated on 15 Dec 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