0.0.2 • Published 8 years ago
fixer-rate v0.0.2
fixer-rate
A foreign exchange rates and currency conversion API.
The rates are updated daily around 4PM CET.
Install
$ npm install --save fixer-rate
Usage
import {getRates, convert} from 'fixer-rate'
getRates().then(rates => {
console.log(rates)
})
convert(1000, {from: 'USD', to: 'BRL'}).then(res => {
console.log(res)
})
API
.getRates(base)
base
Type: string
Default: USD
Options: options
get the latest rates
.convert(value, currencies)
value
Type: number
Default: 1
Required
currencies
Type: object
{from: CURRENCY_1, to: CURRENCY_2}
Required
convert from a currency to another.
License
MIT © Bu Kinoshita