glass-script

a safe JSON path expression and simple scripting language. Suitable for evaluating untrusted javascript like code in a sandbox.

npm install glass-script
24 downloads in the last month

glass

Glass Safe Scripting Language

Glass is a minimalist scripting language to allow you to safely evaluate path expressions and small programs that may contain untrusted code.

Glass is very similar to JSON Path but it adds the ability to evaluate locally defined functions, execute multiple statements including variable declarations and conditional branches.

There are no for loops and scripts can only call functions or reference properties that are defined directly on the context object.

When using a simple JSON tree as the context Glass Scripts are designed to be inherently safe to evaluate without any possibility of external side effects, and no ability to block the thread since there are no for or while loops.

use 'glass' command line utility to test expressions.

npm loves you