jsonSQL is a lightweight JavaScript library that allows querying JSON objects with a SQL-like syntax. It supports field selection (`*`, nested fields), conditions (`where`) with AND (`&&`), OR (`||`), grouping, and comparisons (`=`, `!=`, `like`, `!~`, `<`, `>`, `<=`, `>=`). Version 0.2.5 is the latest stable release. The library works with nested objects and arrays, supports date comparisons via timestamps, and returns matching objects as an array. It is designed for simple in-memory queries on JavaScript objects without a database, but has limited advanced features like aggregation or joins.
npm install jsonsqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Query a JSON object using SQL-like syntax: select all fields where age > 30.
Use const Query = require('jsonsql'); (all lowercase)Access result fields using bracket notation: result['holy.addr']
Write condition as 'holy.name=CRAP' not 'holy.name="CRAP"'
Use: where birth>' + new Date(2015,1,1).valueOf()
Consider alternatives like jmespath or jsonpath
Use default import: import jsonsql from 'jsonsql' or const jsonsql = require('jsonsql')No dependency data recorded yet.