Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

jlens evaluates JSONata expressions against JSON documents. You can use it to filter, query and transform payloads, and to express business rules whose outcome must be explained.

It ships in three forms that share a single engine:

DistributionPackageUse it for
Rust cratejlens-core (+ jlens-schema)Embedding the engine in Rust services
Command linejlens binaryScripts, pipelines, NDJSON filtering, debugging expressions
WebAssemblyjlens-wasm (npm package, ES module)Browsers: evaluation, editors with autocomplete, audit viewers

To try it without installing anything, open the web editor: it runs jlens in your browser, with completion, diagnostics, and the explanation and audit tree of every result.

What sets jlens apart from other JSONata implementations:

  • Explainable evaluation. jlens can record an audit tree of how an expression reached its result: which comparisons passed or failed, which items a filter rejected, and which values were bound. You can attach business labels through ordinary JSONata comments (annotations), so the expression stays valid in any other JSONata implementation.
  • Schema-driven assistance. jlens infers structural metadata from sample documents. It then uses that metadata to offer completion, diagnostics and hover information for expressions being written, in the browser and in editors (language server).
  • Conformance first. The engine is checked against the official JSONata test suite (2.2.2) on every change, and against jsonata-js itself with generated expressions every week; see Conformance testing.

Status: jlens 0.16 implements all of JSONata 2.2 (1,688 of the 1,690 official test cases, with the other two documented), host functions, evaluation audits, schema-driven editor support with a language server, a command line for scripts and agents that checks and tests expressions, and the browser package. See the roadmap.