[-] jay0072007@programming.dev 9 points 16 hours ago

100% agreed. It's just a learning/hobby project, to know more about parsers, and how languages work. Some of the features like Wildcard, Multiple key selection/omission comes handy, and might add more features like that.

[-] jay0072007@programming.dev 5 points 17 hours ago

Thanks for sharing the project! JQLite is aimed to run in browsers and node, but will definitely take inspiration from "jq".

[-] jay0072007@programming.dev 5 points 17 hours ago

That's a great project! JQLite is mainly focused on query-style approach. Also it's a hobby project for learning parsers and stuff.

[-] jay0072007@programming.dev 3 points 18 hours ago

Thanks for your suggestion! It's definitely something I'll look into.

11

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

59
submitted 21 hours ago* (last edited 16 hours ago) by jay0072007@programming.dev to c/programming@programming.dev

Created a simple query language for JSON data.

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 the list of adult friends:

$.friends[?(@.age >= 18)]

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

⭐ Leaving a star on GitHub is much appreciated!

jay0072007

joined 21 hours ago