@keita-sama69/currencyconverter
v1.0.3
Published
converts currencies, using USD as a base.
Downloads
2
Readme
This is a super simple currency converter that uses USD as a base currency.
It its current state its stupidly inefficient but hey it works.
It only has 12 currencies (not including USD itself) as of v1.0.2 and will have more as the package gets worked on.
The currencies are up to date as of 16 Oct 2021
As of v1.0.2 these are the currencies that are available:
- KRW | Korean Won
- CNY | Chinese Yuan
- TRY | Turkish Lira
- JPY | Japanese Yen
- ZAR | South African Rand
- GBP | Great Britian Poun
- BRL | Brazilian Real
- SGD | Singapore Dollar
- AUD | Australian Dollar
- RUB | Russian Ruble
- INR | Indian Rupee
- EUR | European Euro
Usage
Input
let { convert } = require('@keita-sama69/currencyconverter')
let converted = convert(1, "JPY")
console.log(converted)
Output
114.38
Other ways to convert
Specific currencies:
//The package now has functions for each currency
let { inYen } = require('@keita-sama69/currencyconverter');
console.log(inYen(1))
Output
114.38
Much less tedious than the above example, One function that does it all
//the package also has this cool one that makes the above method look dumb
let { Convert } = require('@keita-sama69/currencyconverter');
console.log(Convert.inYen(1))
Output
114.38