Registry / database / caql-js-compiler

caql-js-compiler

JSON →
library0.5.0jsnpmunverified

A JavaScript library that compiles CaQL (Calypso Query Language) queries into executable JavaScript functions. Current stable version is 0.5.0, released with no recent updates (likely abandoned). It allows filtering, sorting, and projecting arrays of objects using a SQL-like query syntax. Compared to libraries like Sequelize or Knex, this is a client-side query engine for in-memory data, not a database ORM. It provides a simple compiler and executor pattern, but lacks TypeScript definitions, ESM support, and has seen no maintenance since its release.

npm install caql-js-compiler
INSTALL
IMPORT
SIG · CAQL-JS-COMPILER
C
caql-js-compiler
databasejavascriptv0.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

JSCompiler
const JSCompiler = require('caql-js-compiler');
const JSCompiler = require('caql-js-compiler').default;
CommonJS only; no default export.
JSCompiler
import JSCompiler from 'caql-js-compiler';
import { JSCompiler } from 'caql-js-compiler';
ESM via default import works with bundlers, but package has no ESM declaration.

Basic usage: query an array of objects with select, where, and order by clauses.

const JSCompiler = require('caql-js-compiler'); const data = [ { name: 'Alice', age: 30 }, { name: 'Bob', age: 25 }, { name: 'Charlie', age: 35 } ]; const compiler = new JSCompiler(); const query = 'select name, age where age >= 30 order by age desc'; const results = compiler.compile(query).execute(data); console.log(results); // [ { name: 'Charlie', age: 35 }, { name: 'Alice', age: 30 } ]
Debug
Known issues
deprecatedPackage has not been updated since 2014; may contain unpatched vulnerabilities.
fix
Consider using a maintained alternative like 'sift.js' for querying arrays.
affects: all
gotchaRequires CommonJS (Node.js); no ES module build provided.
fix
Use require() or a bundler with CommonJS interop.
affects: 0.5.0
gotcha`execute()` returns an array; it does not modify the original data.
fix
Assign the result to a new variable.
affects: all
gotchaField names from CaQL SELECT are case-sensitive and must match object keys exactly.
fix
Ensure field names match object property names.
affects: all
Errors
Common errors & fixes
Cannot find module 'caql-js-compiler'
Package not installed.
fix
Run `npm install caql-js-compiler`
compiler.compile is not a function
Incorrect import (maybe used .default).
fix
Use `const JSCompiler = require('caql-js-compiler');` and then `new JSCompiler()`.
Upgrade
Version history
0.5.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
caql-js-compiler — npm install caql-js-compiler · libregistry