currency
Script
v4
Fork
1
2
3
4
5
6
7
8
9
import
{
fetchJSON
}
from
"https://esm.town/v/radu/fetchJSON?v=3"
;
export
let
currency
=
async
(
base
=
"usd"
,
desired
?
:
string
=
"php"
)
=>
{
let
{
rates
}
=
await
fetchJSON
(
`https://open.er-api.com/v6/latest/
${
base
}
`
,
)
;
return
rates
;
}
;
// Forked from @radu.currency