Rakexl is an opinionated fork of jexl-extended by Niko Raes, which extends the Jexl expression parser and evaluator by TomFrost.
- 80+ Built-in Functions - String manipulation, math, arrays, objects, dates, and more
- Monaco Editor Support - Syntax highlighting, IntelliSense, and hover documentation
- TypeScript Support - Full type definitions included
- Modular - Use the entire library or import individual functions
Full documentation available at rxl.rakerone.sh
npm install rakexlimport jexl from 'rakexl';
const data = [
{name: "John", age: 32},
{name: "Jane", age: 34},
{name: "Bob", age: 33}
];
const result = jexl.evalSync('data|filter("value.age > 32")|map("value.name")|join(", ")', {data});
// "Jane, Bob"Get a rich IDE experience for JEXL expressions:
import * as monaco from 'monaco-editor';
import { Monaco } from 'rakexl';
// Register JEXL language support
Monaco.registerJexlLanguage(monaco);
// Create editor with JEXL support
const editor = Monaco.createJexlEditor(monaco, document.getElementById('editor'), {
value: 'users|filter("value.active")|map("value.name")|sort',
theme: 'vs-dark'
});It is also possible to use the extended grammar in the original Jexl library by importing parts of the grammar you need and adding it to the Jexl instance.
import jexl from 'jexl';
import { arrayMap } from 'rakexl/extended-grammar';
jexl.addTransform('map', arrayMap);
const result = jexl.evalSync('[{name:"tek",age:32}, {name:"bar",age:34}, {name:"baz",age:33}, {name:"foo",age:35}]|map("value.age")');
// [32, 34, 33, 35]