Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
safe-expr-eval — Secure expression evaluator - Drop-in replacement for expr-eval without CVE-2025-12735 vulnerability | Kitploit
Tools/GitHubGitHub/alecasg555/safe-expr-eval
General Purpose UtilitiesCode AnalysisScripting & Automation
GitHubalecasg555/safe-expr-eval

safe-expr-eval

Secure expression evaluator - Drop-in replacement for expr-eval without CVE-2025-12735 vulnerability

View Repository
41395 months agoNot yet reviewed
Share

safe-expr-eval

Fast and lightweight expression evaluator for JavaScript and TypeScript.

A modern expression parser with a familiar API, zero dependencies, and full TypeScript support.


Features

  • Fast expression parsing and evaluation
  • Lightweight and dependency-free
  • Full TypeScript support
  • Simple and familiar API
  • Custom functions and constants
  • ES2020+ compatible
  • Well tested

Installation

npm install safe-expr-eval

Quick Start

Basic Usage

import { Parser } from 'safe-expr-eval';

const parser = new Parser();
const expr = parser.parse('2 * x + 1');

console.log(expr.evaluate({ x: 3 })); // 7
console.log(expr.evaluate({ x: 10 })); // 21

Direct Evaluation

import { evaluate } from 'safe-expr-eval';

const result = evaluate('10 + 5 * 2');

console.log(result); // 20

Compiled Expressions

import { compile } from 'safe-expr-eval';

const fn = compile('price * quantity * (1 - discount)');

console.log(
  fn({
    price: 100,
    quantity: 2,
    discount: 0.1
  })
); // 180

Supported Operations

Arithmetic

+  -  *  /  %

Comparison

==  !=  >  <  >=  <=

Logical

and  or  not
&&   ||   !

Data Types

Numbers   → 42, 3.14
Strings   → "hello"
Booleans  → true, false
Variables → price, user.name

Custom Functions

const parser = new Parser();

parser.functions.max = Math.max;
parser.functions.min = Math.min;
parser.functions.round = Math.round;

const expr = parser.parse(
  'round(max(a, b) * 1.5)'
);

console.log(
  expr.evaluate({
    a: 10,
    b: 20
  })
); // 30

Constants

const parser = new Parser();

parser.consts.PI = Math.PI;
parser.consts.TAX_RATE = 0.15;

const expr = parser.parse(
  'price * (1 + TAX_RATE)'
);

console.log(
  expr.evaluate({
    price: 100
  })
); // 115

API

Parser

Create parser

new Parser()

Parse expression

parser.parse(expression)

Evaluate expression

parser.evaluate(expression, variables?)

Functions registry

parser.functions

Constants registry

parser.consts

Standalone Functions

evaluate

evaluate(expression, variables?)

compile

compile(expression)

Testing

npm test
npm run test:coverage

License

MIT

See the LICENSE file for details.


Contributing

Pull requests and contributions are welcome.


Issues

Please open an issue if you find a bug or have a feature request.


Author

Alejandro Castrillon

GitHub: https://github.com/
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    755
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    510
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    415
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    343
  • 5

    antifox

    antifox-ai/antifox

    AI multi-agent autonomous penetration testing platform that runs recon, attack-surface discovery, exploitation validation and evidence-backed report delivery.

    259
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    258

Explore all tools

Browse our collection of tools

View all tools →