{"library":"vega-expression","type":"library","category":null,"description":"vega-expression is a JavaScript/TypeScript library that provides a secure and configurable expression parser and code generator, forming a core component of the broader Vega visualization toolkit. It processes a limited subset of JavaScript expressions into an Abstract Syntax Tree (AST) and then generates `eval`'able JavaScript code. The library intentionally restricts language features like assignment operators, `new` expressions, and control flow to prioritize security and prevent unwanted side effects, making it suitable for user-provided expressions in visualization contexts. It is currently in active development, with version 6.2.0 as the latest stable release at the time of this entry, following a fairly active release cadence that often aligns with the larger Vega monorepo. Its key differentiators include its security-first approach, a stripped-down Esprima-based parser, and highly configurable code generation options for managing constants, functions, and variable scopes, including tracking data field dependencies.","language":"javascript","status":"active","version":"6.1.0","tags":["javascript","vega","expression","parser","codegen","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install vega-expression","imports":["import { parse } from 'vega-expression';","import { codegen } from 'vega-expression';","import type { CodegenOptions } from 'vega-expression';"]},{"cmd":"yarn add vega-expression","imports":[]},{"cmd":"pnpm add vega-expression","imports":[]}],"homepage":null,"github":"https://github.com/vega/vega","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/vega-expression","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/vega-expression/compatibility"}}