9

JQLite - The query language for JSON.

Created a simple query language in Typescript.

Features:

  • Basic query selection
  • Fallback Mechanism
  • Wildcard support
  • Array Slices
  • Multiple Key Selection
  • Key Omission
  • Single Key Omission
  • Functions
  • Comparison Operators
  • Conditions
  • Configurable

Here's an example to get a list of all products with an average review more than 4:

$.products[?(@.reviews.#avg() > 4)]

Runs in browsers, and Node.js

Documentation site: https://jqlite.vercel.app/

GitHub: https://github.com/Jay-Karia/jqlite

NPM Package: https://www.npmjs.com/package/jqlite-ts

Data source for the query: https://jqlite.vercel.app/demo.json

top 5 comments
sorted by: hot top controversial new old
[-] bokster@lemmy.sdf.org 5 points 3 days ago

Just wondering - what's wrong with jq's query language? or JSONPath, which is even a RFC?

What's the motivation behind creating a new query language?

[-] jay0072007@programming.dev 2 points 2 days ago* (last edited 2 days ago)

jq and JSONPath are awesome projects, and JQLite is not a replacement for existing tools, but a learning project.

[-] spoonbill@programming.dev 1 points 3 days ago

Yet another alternative is jsonata.org

[-] bokster@lemmy.sdf.org 3 points 3 days ago

Yeah,

I feel like we already have a lot of JSON query languages. So one more is fine, if it's somehow different and is addressing a problem which the others have missed.

I however, do not see that, so hence my question.

[-] jay0072007@programming.dev 1 points 2 days ago

Thanks for your feedback! Will definitely look forward and add the missing features.

this post was submitted on 11 May 2025
9 points (76.5% liked)

Opensource

2668 readers
54 users here now

A community for discussion about open source software! Ask questions, share knowledge, share news, or post interesting stuff related to it!

CreditsIcon base by Lorc under CC BY 3.0 with modifications to add a gradient



founded 2 years ago
MODERATORS