Socket
Book a DemoInstallSign in
Socket

currency-map-symbol

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

currency-map-symbol

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

4.0.5
latest
Source
npmnpm
Version published
Weekly downloads
1.3K
11.03%
Maintainers
1
Weekly downloads
 
Created
Source

currency-map-symbol

Build Status PRs Welcome Known Vulnerabilities

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

Installation

npm install currency-map-symbol

Test

Simple test

npm run test

Test with watch

npm run test:watch 

Test coverage

npm run test:coverage  
     

Usage

Get symbol from currency code

// ES5
const getSymbolFromCurrency = require('currency-map-symbol')

// ES6
import getSymbolFromCurrency from 'currency-map-symbol'

getSymbolFromCurrency('GBP') //=> '£'
getSymbolFromCurrency('EUR') //=> '€'
getSymbolFromCurrency('USD') //=> '$'
getSymbolFromCurrency('NOT A VALID CODE') //=> undefined

Exposed map for other processing

// ES5
const getSymbolFromCurrency = require('currency-map-symbol')

// ES6
import getSymbolFromCurrency from 'currency-map-symbol'

/* =>
{
 "USD" : "$",
 "GBP" : "£",
 …
}
*/

Credits

Currency symbols originally sourced from xe

Keywords

currency

FAQs

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.