simple-eval is a JavaScript expression evaluator for evaluating a deliberately limited subset of JavaScript expressions. It supports optional context values, and it can use an ESTree compliant parser like jsep (default) or alternatives such as acorn, @babel/parser, or esprima, while blocking certain dangerous access patterns. It is useful for computing expressions from strings with basic operators and selected globals, but it is not a sandbox for untrusted input.
Project status
- The source appears to be largely dormant, with no tagged
updatessincev2.0.0on 2025-05-30, even though there was an upstream push on 2026-06-10. Based on publishedupdates, maintenance looks low. - Update cadence is sparse: v0.0.0 (2021-03), v0.0.1 (2021-10), v1.0.0 (2021-10), v1.0.1 (2022-07), then a large jump to v2.0.0 (2025-05). This suggests long intervals between meaningful changes.
AI summary generated
Recent updates
v2.0.0
v2.0.0 is a major internal rewrite of the library from JavaScript (.mjs) to TypeScript (.ts), with a build/test/tooling overhaul and a move to ESM packaging. The evaluator logic in reduce.ts was substantially changed, including how unary operators and array elements are handled. Release notes were not provided, so these behavioral and packaging changes are effectively undocumented.
BreakingFeaturesv1.0.1
v1.0.1 does not include any publisher release notes. The code diff shows the package version bump, addition of TypeScript type entry points in the exports map (including a new reduce.d.ts), and substantial dependency updates (notably a runtime dependency bump of jsep).
Featuresv1.0.0
Release v1.0.0 is published, but no release notes were provided by the publisher. As a result, this upgrade cannot be evaluated for specific new features, breaking changes, bug fixes, or security updates based on the release documentation alone.
v0.0.1
Release v0.0.1 ships with no published release notes. The code change indicates the library now accepts ESTree-style AST objects as input (in addition to parsing from a string), adds Program/ExpressionStatement handling, and improves support for expressions parsed by external parsers like espree. It also upgrades the jsep dependency significantly.
BreakingFeaturesv0.0.0
This release is tagged v0.0.0, but no release notes were provided by the publisher. Because no documented changes are available, there is no actionable information here to assess API compatibility, breaking changes, or migration steps.