1.0.0 β€’ Published 2 years ago

fast-convert-currency v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

All currency units, convert in the simplest way!

npm i fast-convert-currency

GitHub package.json version npm

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);
})();

NPM

Link