1.0.2 • Published 3 years ago

@mrzaghar/node-currency-converter v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Installation

npm install @mrzaghar/node-currency-converter

Usage

const currencyConverter = new (require('@mrzaghar/node-currency-converter'))
(async () => {
    var toGbp =await currencyConverter.from('USD').to('GBP').convert(300);
    
    // from USD to GBP
    console.log(toGbp.result) // 216.88
    console.log(toGbp.beautify) // £216.88

})()

Example

const currencyConverter = new (require('@mrzaghar/node-currency-converter'));
(async () => {
    var toGbp =await currencyConverter.from('USD').to('GBP').convert(300);
    var toEUR =await currencyConverter.from('GBP').to('EUR').convert(300);
    
    // from USD to GBP
    console.log(toGbp.result) // 216.88
    console.log(toGbp.beautify) // £216.88

    // from GBP to EUR
    console.log(toEUR.result) // 352.38
    console.log(toEUR.beautify) // €352.38

    // Convert from Bitcoin to USD
    var btcToUSD = await currencyConverter.from('BTC').to('USD').convert(1);

    console.log(btcToUSD.result) // 58855.9
    console.log(btcToUSD.beautify) // $58,855.90
})()
1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago