Documentation
This commit is contained in:
parent
912e68453b
commit
c69f0d1c11
|
@ -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"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue