Keep rules like order.total >= 50 as text, in your config, your database, or your users' hands. Bonsai checks them against your types, runs them safely, and explains every result.
If the same rules must also run in Go or Java, use CEL. For a visual builder that stores JSON, use json-logic.
Library
Rules are
Checked against types
Suggests fixes
Explains results
Filters a database
Browser, gzip
bonsai-js
Text, JS-like
✓Yes
✓Yes
✓Yes
✓Yes
29.0 KB 69.2 KB checking in the browser
cel-js
Text, CEL
✓Yes
–No
–No
–No
24.3 KB
json-logic-js
JSON
–No
–No
–No
–No
2.0 KB
jexl
Text, JS-like
–No
–No
–No
–No
6.1 KB
filtrex
Text, own syntax
–No
–No
–No
–No
7.8 KB
Bonsai's 29.0 KB is for rules checked on a server. The full comparison covers nine libraries, what each part of Bonsai's size buys, and when each library is the better choice.
Try it on one rule.
Five minutes from install to your first checked rule.