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.
built-in-math-eval
Advanced tools
Readme
Evaluate mathematical expression with the built-in math object
Table of Contents generated with DocToc
This module evaluates the generated code from math-codegen
for the built in Math
namespace providing the necessary adapter methods
$ npm install --save built-in-math-eval
var compile = require('built-in-math-eval');
code = compile(expression)
params
expression
{string} the expression to be parsedreturns {Object}
return.eval
{function} The compiled function to be called with some scope variablesreturn.eval([scope])
params
scope
{Object}An optional object which holds some variables to be used in the expression,
all variables are casted to Number
returns {*} a number or a boolean value depending on the operation made
Also have a look at test/index.js
var compile = require('built-in-math-eval');
// > 3
compile('1 + 2').eval()
// > 8
compile('2^3').eval()
// > 8
compile('x^3').eval({ x: 2 })
// > 1
compile('cos(x)').eval({ x: 0 })
// > 8
compile('2x^2').eval({ x: 2 })
// > 3.1415
compile('PI').eval()
2015 © Mauricio Poppe
FAQs
Evaluate mathematical expression with the built-in math object
The npm package built-in-math-eval receives a total of 2,200 weekly downloads. As such, built-in-math-eval popularity was classified as popular.
We found that built-in-math-eval 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.