I've made a javascript library to simplify searching/sorting/filtering in arrays of objects. Its inspired by both GraphQL and SQL, but implemented using javascript Proxies. Instead of creating a new language, its all just javascript.
I've made it as part of an experimental database, which uses javascript as the query engine. The normal javascript map/reduce/sort functions are quite difficult to master for junior developers. JAQT is easier to explain, and can still be used in combination with any existing array functions.
Please let me know what you think of the API and its ease of use!
data.filter(d => d.friends.includes("John")).map(d => ({name: d.name+" "+d.lastName}))
Maybe I'm missing the bigger picture, but that doesn't seem so bad
[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
[2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Typically I use something like JSONPath [1] (basically XPath for JSON) [2] or jq for this but having more options with other syntax and style is helpful.
For streamed JSON like NDJSON [3] there are some nice filtering options [4]
[1] https://en.wikipedia.org/wiki/JSONPath
[2] https://datatracker.ietf.org/doc/html/rfc9535
[3] https://github.com/ndjson/ndjson-spec
[4] https://github.com/mbostock/ndjson-cli?tab=readme-ov-file#fi...
I've also used https://github.com/uwdata/arquero once (better performance for large datasets).