Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
evalculist
Advanced tools
Readme
evalculist
provides a way to evaluate arbitrary javascript expressions in a controlled way, without exposing global variables. It accomplishes this by parsing the expressions such that variables become strings that are passed to variable
, accessor
, and assignment
functions.
foo = bar.baz
becomes
assignment("foo", accessor(variable("bar"), "baz"))
Using evalculist.new
const localVars = {
a: { b: 1 },
c: 2
};
const evaluate = evalculist.new({
variable: (name) => localVars[name] || Math[name],
accessor: (object, key) => object[key],
assignment: (name, value) => (localVars[name] = value)
});
const result = evaluate('pow(a.b + 1, c)');
// result === 4
Using evalculist.newFromContext
const context = {
a: { b: 1 },
c: 2,
pow: Math.pow
};
const evaluate = evalculist.newFromContext(context);
const result = evaluate('pow(a.b + 1, c)');
// result === 4
{a:1}
does not work, but {"a":1}
does).if
,for
,var
, etc.).License MIT
FAQs
scoped eval for simple js expressions
The npm package evalculist receives a total of 9 weekly downloads. As such, evalculist popularity was classified as not popular.
We found that evalculist demonstrated a not healthy version release cadence and project activity because the last version was released 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.