Filtrex is a simple and safe JavaScript expression compiler designed for end-user input. It lets users write spreadsheet-like filter expressions without giving them access to raw JavaScript execution. Instead of using eval, Filtrex compiles expressions into JavaScript functions while keeping data access and callable functions under developer control. It supports common use cases such as filtering items, searching across fields, colorizing records, plotting charts, and building browser-based spreadsheet behavior. The expression language supports numbers, strings, external variables, arithmetic, comparisons, regular expression matching, and logical operations. Overall, it gives applications a safer way to let users define dynamic rules and filters.
Features
- Safe JavaScript expression compilation
- Spreadsheet-like expression language for end users
- No eval-based arbitrary JavaScript execution
- Developer-controlled data and function access
- Support for strings, numbers, arithmetic, and comparisons
- Useful for filters, searches, charts, and rule-based UI logic