Skip to content

samyan/ratesjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ratesjs Version License

Library for get currencies rates from different sources. The currently supported sources are Binance and Yahoo.

Install

npm i ratesjs

Usage

Example 1

const  currencyRates = new  CurrencyRates();

const  result = await  currencyRates
    .getProvider('yahoo')
    .setBase('USD')
    .setTargets(['RUB', 'GBP'])
    .getResult('latest');
{ RUB: '73.6008', GBP: '0.82162' }

Example 2

const  currencyRates = new  CurrencyRates();

const  result = await  currencyRates
    .getProvider('binance')
    .setBase('USDT')
    .setTargets(['BTC', 'ETH'])
    .getResult('latest');
{ BTC: '22175.80000000', ETH: '1552.45000000' }

About

Library for get currencies rates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published