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

@divvit/currency-converter

Package Overview
Dependencies
Maintainers
3
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@divvit/currency-converter

Convert a value from one currency to another according to exchange rate of a certain day.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-84.62%
Maintainers
3
Weekly downloads
 
Created
Source

Currency Converter

A small library to convert currencies according to the EZB exchange rates.

Installation

npm install @divvit/currency-converter --save

Usage

  var converter = require('@divvit/currency-converter')();
  // if you want to change the storage path, call the script like that:
  // var converter = require('@divvit/currency-converter')({ storageDir: '/some/other/path' });
  // the default path is process.env.TMPDIR

  var moment = require('moment');

  var eurValue = 10;
  var conversionDate = moment('2015-01-01');
  converter.convert(eurValue, conversionDate, 'EUR', 'USD', function(err, usdValue) {
    if (err)
      return callback(err);

    console.log('Converted ' + eurValue + ' EUR to ' + usdValue + ' USD, according to FX rate of ' . conversionDate.format('DD.MM.YYYY') );
  });

Tests

npm test

Contributing

Nino Ulsamer, Divvit AB

Release History

  • 1.0.1 Improved README formatting
  • 1.0.0 Initial release

Keywords

FAQs

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