Documentation

This commit is contained in:
Nox Sluijtman 2025-01-21 12:17:56 +01:00
parent 912e68453b
commit c69f0d1c11
Signed by: Egg
SSH key fingerprint: SHA256:2sG9X3C7Xvq2svGumz1/k7cm8l4G9+qAtAeugqB4J9M

View file

@ -4,10 +4,15 @@
let base_url = 'https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1'
def main [target:string = "usd", source:string = "eur"] {
# Convert one unit of a currency to another using the following API:
# https://github.com/fawazahmed0/exchange-api
def main [target:string = "usd" # Unit of curency to convert to
source:string = "eur" # Base currency to convert from
] {
$"((http get $"($base_url)/currencies/($source).json") | get $source | get $target)\n"
}
# Lists all available currencies
def "main list" [ ] {
http get $"($base_url)/currencies.json"
}