currency-map-country
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
;; //=> { abbreviation: 'US', currency: 'USD' }; //=> { abbreviation: 'CA', currency: 'CAD' }
Get currency data from currency abbreviation
;; //=> { name: 'U.S. Dollar (USD)', symbolFormat: '${#}' }; //=> { name: 'Canadian Dollar (CAD)', symbolFormat: 'C${#}' }
Get currency abbreviation from a country name
;; //=> 'GBP'; //=> 'CAD'
Get country from abbreviation
;; //=> 'UK'; //=> 'USA'
Get Currency List
;; //=> [ { abbr: "AFA", name: "Afghanistan Afghani (AFA)", symbolFormat: "AFA {#}" }, { abbr: "ALL", name: "Albanian Lek (ALL)", symbolFormat:, "ALL {#}" }, ... ]
Get Currency Abbreviation From Name
;; //=> 'USD'