
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@ithinku/expr
Advanced tools
A powerful and type-safe TypeScript expression parser and evaluator.
Capable of parsing mathematical expressions, handling variables, and executing safe evaluations.
eval() or Function().+, -, *, /, unary -.1.2e3, 1e-5.npm install @ithinku/expr
import { Expression } from '@ithinku/expr';
// Basic math
const result = Expression.evaluate('2 * (3 + 4)');
console.log(result); // 14
// Scientific notation
console.log(Expression.evaluate('1e2 * 3')); // 300
import { Expression } from '@ithinku/expr';
const context = {
x: 10,
y: 5,
user: {
age: 18
}
};
// Access variables including nested properties
const result = Expression.evaluate('x * y + user.age', context);
console.log(result); // 10 * 5 + 18 = 68
For better performance when evaluating the same expression multiple times with different variables.
import { Parser, Evaluator } from '@ithinku/expr';
// 1. Parse once (Build AST)
const parser = new Parser('x * 2 + y');
const ast = parser.parse();
// 2. Create Evaluator
const evaluator = new Evaluator({ x: 10, y: 1 });
// 3. Evaluate multiple times
console.log(evaluator.evaluate(ast)); // 21
// Update variable
evaluator.setVariable('x', 20);
console.log(evaluator.evaluate(ast)); // 41
try {
Expression.evaluate('1 / 0');
} catch (error) {
// Error: Division by zero
}
try {
Expression.evaluate('unknown_var * 2');
} catch (error) {
// Error: Undefined variable: unknown_var
}
MIT
FAQs
A TypeScript expression parser library
We found that @ithinku/expr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.