0.0.2 • Published 7 years ago

fixer-rate v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

fixer-rate

A foreign exchange rates and currency conversion API.

Codeship Status for bukinoshita/fixer-rate GitHub release GitHub license

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