A standards-oriented JMESPath parser and JSON query engine in MoonBit.
moon add JingLan0v0/jmespath@0.1.36import {
"JingLan0v0/jmespath" @jmespath,
}
pkgtype(kind: "executable")fn main raise {
let input = @jmespath.parse_json_bounded("{\"items\":[{\"name\":\"Ada\"}]}")
let query = @jmespath.compile("items[*].name")
println(@jmespath.stringify_bounded(query.search(input)))
}git clone https://github.com/JingLan0v0/moonbit-jmespath.git
cd moonbit-jmespath
moon run cmd/main --target js -- --compact "instances[?state == 'running'].id" examples/cloud-inventory.jsonnode examples/demo.mjs| Scenario | Result |
|---|---|
| Cloud inventory | IDs and zones for running production instances |
| Deployment policy | Blocked services and their nested reason codes |
| Cost report | Services sorted by monthly cost |
node scripts/verify.mjsfn search_json(expression : String, json_text : String, limits? : Limits) -> Json raise JmesPathErrorInstall
Download zipA standards-oriented JMESPath parser and JSON query engine in MoonBit.