mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 03:05:14 +00:00
15 lines
385 B
JavaScript
Executable File
15 lines
385 B
JavaScript
Executable File
const { CurrencyService } = require("m3o/currency");
|
|
|
|
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
|
async function convert10usdToGbp() {
|
|
let currencyService = new CurrencyService(process.env.MICRO_API_TOKEN);
|
|
let rsp = await currencyService.convert({
|
|
amount: 10,
|
|
from: "USD",
|
|
to: "GBP",
|
|
});
|
|
console.log(rsp);
|
|
}
|
|
|
|
convert10usdToGbp();
|