fast-convert-currency
v1.0.0
Published
Convert currency with nodejs
Downloads
923
Maintainers
Readme
All currency units, convert in the simplest way!
npm i fast-convert-currency
Features:
- The conversion of all currencies. ✅
- Simplified module ✅
- Quick turnaround time✅
Usage
Very easy, you don't even need to use the documentation, actually.😉
- getExchangeRate ()
const { getExchangeRate } = require('fast-convert-currency');
getExchangeRate('USD', 'TRY'); // async
example;
(async () => {
const rate = await getExchangeRate('USD', 'TRY');
console.log(rate);
/*
{
amount: 29.97,
lastUpdated: 'an hour ago'
}
*/
})();
- convertCurrency()
const { convertCurrency } = require('fast-convert-currency');
convertCurrency('USD', 'TRY', 100);
(async () => {
const converted = await convertCurrency('USD', 'TRY', 100);
/*
{
data: {
amount: '2997.00',
currency: 'TRY'
},
message: '100 USD is worth 2997.00 TRY.'
}
*/
console.log(converted);
})();