currency-converter

currency-converter ==================

npm-currency-converter

Conversion rates between currencies and rate conversion!

Start Register for your openexchangerates. install the package ``` npm install currency-converter ``` require the module. NOTE: Default fetchInterval value is set to one hour. ``` var cc = require('currency-converter')({ CLIENTKEY: YOUR_OPEN_EXCHANGE_RATES_KEY, [fetchInterval: 3600000] }); ``` Usage This module makes it extremelyeasy for you to convert currencies. The very basic input takes in two parameters. convertFrom & convertTo have to be valid country codes. See list here. The module fetches live rates on initialize, saves it locally, and retrieves locally saved rates by default, unless otherwise specificed.

.convert(amount, convertFrom, convertTo, [live])

converts an amount specificed to a specific currency. liveis an optional parameter that uses live rates from openexchangerates.org
{
    "currency": "EUR",
    "symbol": "€",
    "amount": 0.76
}

.rates(convertFrom, convertTo, [live])

returns the conversion rate between two currencies. ``` .rates('USD', 'EUR') // => 0.76 ```

HomePage

https://github.com/mamarildon/npm-currency-converter

Repository

https://github.com/mamarildon/npm-currency-converter.git


上一篇:money-math
下一篇:@edenjs/user-settings

相关推荐

  • zigbee-shepherd-converters

    Collection of device converters to be used with zigbeeshepherd NPM(https://nodei.co/npm/zigbeesheph...

    1 个月前
  • webp-converter

    A small node.js library for converting any image to webp file format or converting webp image to any...

    6 个月前
  • typographic-currency-db

    Raw data about typographic currency typographiccurrencydb NPM versionnpmimagenpmurl Raw data ab...

    7 个月前
  • react-currency-input

    React component for inputing currency amounts reactcurrencyinput An ES2015 react component for cu...

    1 个月前
  • react-currency-conversion

    Converts given currency pair and value. reactcurrencyconversion CDN by jsDelivr A free...

    8 个月前
  • promise-each-concurrency

    Process an iterable of promises with concurrency Promise each concurrency Build Status(https://tra...

    1 年前
  • number-currency-format

    Dependencyless price formatting npm version(https://badge.fury.io/js/numbercurrencyformat.svg)(http...

    21 天前
  • nor-currency

    Currency Library for Node.js norcurrency ============ Paranoidly Safe Currency Library for Node.js...

    1 个月前
  • ng2-currency-mask

    A very simple currency mask directive that allows using a number attribute with the ngModel. ng2cu...

    1 年前
  • ng-currency

    Directive that works in conjunction with currency filter. ngcurrency NPM Version(https://img.shie...

    2 年前

官方社区

扫码加入 JavaScript 社区