node package manager

currency-symbol-map

A function to lookup the currency symbol for a given currency code

currency-symbol-map

A function to lookup the currency symbol for a given currency code and vice versa.

npm install currency-symbol-map
var getSymbolFromCurrency = require('currency-symbol-map').getSymbolFromCurrency;
getSymbolFromCurrency('GBP'); //=> '£' 
getSymbolFromCurrency('EUR'); //=> '€' 
getSymbolFromCurrency('USD'); //=> '$' 
getSymbolFromCurrency('NOT A VALID CODE'); //=> undefined 
var getCurrencyFromSymbol = require('currency-symbol-map').getCurrencyFromSymbol;
getCurrencyFromSymbol('£'); //=> 'GBP' 
getCurrencyFromSymbol(''); //=> 'EUR' 
getCurrencyFromSymbol('$'); //=> 'USD' 
getCurrencyFromSymbol('NOT A VALID CODE'); //=> undefined 
var symbolCurrencyMap = require('currency-symbol-map').symbolCurrencyMap;
/*
{
  "$": "USD",
  "£": "GBP",
  ...
}
*/
 
var currencySymbolMap = require('currency-symbol-map').currencySymbolMap;
/*
{
  "USD": "$",
  "GBP": "£",
  ...
}
*/
var getSymbol = require('currency-symbol-map')
getSymbol('GBP') //=> '£' 
getSymbol('EUR') //=> '€' 
getSymbol('USD') //=> '$' 
getSymbol('NOT A VALID CODE') //=> '?' 
npm test

Currency symbols originally sourced from xe, but maintained and updated by contributors.