Very tiny (53 lines including whitespace) library to build ArQL for queries for Arweave https://www.github.com/ArweaveTeam/arweave-js
Packaged up with https://github.com/pikapkg/pack, for web, node, typescript and even deno!
For fun, it's published on the on the arweave blockchain itself :)
npm install https://kybjhezuyftg.arweave.net/ITTPLYoxidZzAJP50FQ03QJUSkkh9iKHcmMcLZOvqtQ
- PROS: exact dependency pinning, immutable blockchain so package can't be removed or replaced with something malicious. (although npm lockfiles and exact versions will take of this too)
- CONS: not exactly easy to remember install line :D manual upgrades
This works because npm can install a .tgz file from any url, so it was just a matter of running
pika build, tar'ing the pkg/ folder it produces, and uploading to arweave.
With spread operators:
or() will take any number of arguments and produce the correct Json of nested expressions:
This will produce a query that matches TXs with the tag 'my-super-tag'=1 , AND any of the color values that match 'my-color-tag'