Skip to content

MrZaghar/node-currency-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Currency Converter

Node Currency Converter library unlimited requests no API needs.

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

About

Node Currency Converter library unlimited requests no API needs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published