Skip to content

asefux/exchange-rates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@asefux/exchange-rates

gather exchange-rates from muiltiplie national banks

Usage

const ExchangeRates = require('@asefux/exchange-rates');

const exchangeRates = ExchangeRates();

exchangeRates.matrix()
.then((ratesMatrix)=>{
        console.log(JSON.stringify(ratesMatrix, null, 2));
});

exchangeRates.rate(10, 'eur', 'usd').then(console.log); // will output how much USD is 10 EUR

Rates matrix of this format

{
        [base]: {
                [quote]: price
        }
}
// how much quote would you get for 1 unit of base

Sources


Changes

Version Changes
1.0.0 initial code
1.0.1 update api
1.1.0 Bank of Bulgaria
1.1.1 on weekends get rates of last working day

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published