Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

currencies

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

currencies

A simple library for currency symbols, names, and exchange rates.

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
90
decreased by-39.6%
Maintainers
1
Weekly downloads
 
Created
Source

#Currencies

A simple library for currency symbols, names, and exchange rates.

##Usage

var currencies = require('currencies');

Initially you have just a map of currency names and symbols, which you can get or set:

currencies.get('USD').symbol === '$';
currencies.get('PLN').name === 'Polish Zloty';

###get

Without an argument, returns the complete currencies map

currencies.get('USD')
currencies.get();

###set

Set a currency's rate (USD-relative) yourself

currencies.set('EUR', 0.77);
currencies.set({
  EUR: 0.77,
  AUD: 1.05
});

###update

Calling this function will update the internal currencies map with current exchange rate, using data from European Central Bank.

currencies.update(function(err, newCurrencies) {
  newCurrencies['USD'].value === 1
});

##License

MIT

FAQs

Package last updated on 11 Apr 2013

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