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

javascript-currency-library

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

javascript-currency-library

The goal of this javascript library is to provide some services with the currencies

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-45.45%
Maintainers
1
Weekly downloads
 
Created
Source

javascript-currency-library

The goal of this library is to provide some services with the currencies. The first one is to give the relationships between currencies and countries.

The data in this repo are pretty raws (ISO codes). To have more display-friendler things, you can use some others library :

  • to translate currency code into symbol : https://github.com/iadvize/javascript-i18n-library

Warning : the lists are not comprehensives ie. all the currencies are not defined and all the countries of a currency neither.

How to install

npm install --save javascript-jsonapi-library

How to use it

    const currencyManager = require('javascript-jsonapi-library');

    console.log(currencyManager.get('GBP').getCountries());
    // output : ['GB']

    console.log(currencyManager.get('EUR').getCountries());
    // output : ['ES','DE','FR', 'IT']

    console.log(currencyManager.findByCountry('FR');
    // output : 'EUR'

    console.log(currencyManager.get('EUR').isAvailableIn('UK'));
    // output : false

Test

npm test

To automatically launch the tests when a file is changed :

npm run-script watch-test

FAQs

Package last updated on 12 Aug 2016

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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc