{"name":"expression-eval","version":"3.1.0","description":"JavaScript expression parsing and evaluation.","source":"index.js","main":"dist/expression-eval.js","module":"dist/expression-eval.module.js","unpkg":"dist/expression-eval.umd.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/donmccurdy/expression-eval.git"},"scripts":{"dev":"microbundle watch","build":"microbundle","test":"node test.js","lint":"cp test.js index.test-d.ts && npx tsd; npm run clean","clean":"rm index.test-d.ts && git checkout -- dist","preversion":"npm run build && npm run test && git add -A dist","postversion":"git push && git push --tags && npm publish"},"keywords":["expression","eval","evaluation","parser","ast","abstract","syntax","tree","math"],"author":{"name":"Don McCurdy","email":"dm@donmccurdy.com"},"license":"MIT","dependencies":{"jsep":"^0.3.0"},"devDependencies":{"microbundle":"^0.11.0"},"gitHead":"102753dce18c6438aac1fdb1128071ed51913058","bugs":{"url":"https://github.com/donmccurdy/expression-eval/issues"},"homepage":"https://github.com/donmccurdy/expression-eval#readme","_id":"expression-eval@3.1.0","_nodeVersion":"12.9.1","_npmVersion":"6.13.6","dist":{"integrity":"sha512-5yP3cCn2U1pyglIQ0ma6/dBfA8fX4Gdo4SV181z25mAhjr15LkNaiV1WFTaLqS3su5xlB6kFtzRC2G+R0V4K/w==","shasum":"ac2dea5626dfed1720fcc174201c7425da02f3e7","tarball":"http://registry-npm.ywwl.com/expression-eval/download/expression-eval-3.1.0.tgz","fileCount":13,"unpackedSize":60514,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiONdCRA9TVsSAnZWagAA9HgP/R+Zp7MQHDsNJjPRPGL5\nizDr3/4dqO0nAJt/GMbbqnAMJlXtDe+gju3Kz4nrDHvIgk5C0Odipou9HAUI\nD3vdBj5ZEcvt16uO9vtPo+w1TtCZcUC2m2iuuMcTPEW4poTLH2JehZvl1im9\nNEymaJ7dhyXQfgqKDotsBa5BrRovelPnfDVPUaP14q991cefofAAdJVJDULU\nbCcyfa3CNs5DSLnq3q8j+9le1Vljxy6SFOkdfh0IP2WYngEx60aywnjfhVzc\nvRKzIXT+kcOEoVcOrnPRgpKJaPf89tpg9GBGCuQ869ajWZCAJ0cAEe2U/v8K\nfRlVSVAcBwCWhSTKPPLZjTHu+zRTapcE9Dk7MiuFDhghrKQQ7t86/nGo8Si/\nLtF8YD2WQy4DRhYZwwSgYzQ757ebTkqIbvrhJbPOr0Pujv2VlgwdH2+eJvTv\nEPlwFKc75oRIkdo+5wjSP9+FxBj2FevL5F+SevGSeB6uC/ghtrC121MwhOpS\nqtHrUMX/j3UdNUkfr9T0gWICNMgi4iZN4xl3CNnvjLtpc8Odvp3TpOcEdIVg\nqeErTXpQ2Zk+T4ffwu7RfJWa0HwrEjgt9UdZ4iH404quN0HkZQHTVM2GOjP+\n1EhQmHRouGwCkFIM+kAfAYSUkRVlFheGOOqCqReCRWDx4R8MQvlW6tIWN+ug\n+qQ4\r\n=aTBu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH+1VXpmjg1UNEnDJSZiDpNkpljCVse7Jc+g+09rn5mrAiEAwiZtQEKVrxk6RjzoWaNdgWi1WEZ1NqQTV/4C5tR894A="}],"size":9671,"noattachment":false,"key":"/expression-eval/-/expression-eval-3.1.0.tgz"},"maintainers":[{"name":"donmccurdy","email":"dm@donmccurdy.com"}],"_npmUser":{"name":"donmccurdy","email":"dm@donmccurdy.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/expression-eval_3.1.0_1586029404514_0.012260281483815083"},"_hasShrinkwrap":false,"deprecated":"The expression-eval npm package is no longer maintained. The package was originally published as part of a now-completed personal project, and I do not have incentives to continue maintenance.","readme":"# expression-eval\n\n[![Latest NPM release](https://img.shields.io/npm/v/expression-eval.svg)](https://www.npmjs.com/package/expression-eval)\n[![Minzipped size](https://badgen.net/bundlephobia/minzip/expression-eval)](https://bundlephobia.com/result?p=expression-eval)\n[![License](https://img.shields.io/badge/license-MIT-007ec6.svg)](https://github.com/donmccurdy/expression-eval/blob/master/LICENSE)\n[![CI](https://github.com/donmccurdy/expression-eval/workflows/CI/badge.svg?branch=master&event=push)](https://github.com/donmccurdy/expression-eval/actions?query=workflow%3ACI)\n\nJavaScript expression parsing and evaluation.\n\n> ⚠️ **UNMAINTAINED:** The `expression-eval` npm package is no longer maintained. The package was originally published as part of a now-completed personal project, and I do not have incentives to continue maintenance. Please feel free to use the code, but be aware that support and updates will not be available.\n\n> ⚠️ **SECURITY NOTICE:** As mentioned under [Security](#security) below, this library does not attempt to provide a secure sandbox for evaluation. Evaluation involving user inputs (expressions or values) may lead to unsafe behavior. If your project requires a secure sandbox, consider alternatives such as [vm2](https://www.npmjs.com/package/vm2).\n\nPowered by [jsep](https://github.com/soney/jsep).\n\n## Installation\n\nInstall:\n\n```\nnpm install --save expression-eval\n```\n\nImport:\n\n```js\n// ES6\nimport { parse, eval } from 'expression-eval';\n// CommonJS\nconst { parse, eval } = require('expression-eval');\n// UMD / standalone script\nconst { parse, eval } = window.expressionEval;\n```\n\n## API\n\n### Parsing\n\n```javascript\nimport { parse } from 'expression-eval';\nconst ast = parse('1 + foo');\n```\n\nThe result of the parse is an AST (abstract syntax tree), like:\n\n```json\n{\n  \"type\": \"BinaryExpression\",\n  \"operator\": \"+\",\n  \"left\": {\n    \"type\": \"Literal\",\n    \"value\": 1,\n    \"raw\": \"1\"\n  },\n  \"right\": {\n    \"type\": \"Identifier\",\n    \"name\": \"foo\"\n  }\n}\n```\n\n### Evaluation\n\n```javascript\nimport { parse, eval } from 'expression-eval';\nconst ast = parse('a + b / c'); // abstract syntax tree (AST)\nconst value = eval(ast, {a: 2, b: 2, c: 5}); // 2.4\n```\n\nAlternatively, use `evalAsync` for asynchronous evaluation.\n\n### Compilation\n\n```javascript\nimport { compile } from 'expression-eval';\nconst fn = compile('foo.bar + 10');\nfn({foo: {bar: 'baz'}}); // 'baz10'\n```\n\nAlternatively, use `compileAsync` for asynchronous compilation.\n\n## Security\n\nAlthough this package does [avoid the use of `eval()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#Do_not_ever_use_eval!), it _cannot guarantee that user-provided expressions, or user-provided inputs to evaluation, will not modify the state or behavior of your application_. This library does not attempt to provide a secure sandbox for evaluation. Evaluation of arbitrary user inputs (expressions or values) may lead to unsafe behavior. If your project requires a secure sandbox, consider alternatives such as [vm2](https://www.npmjs.com/package/vm2).\n\n## License\n\nMIT License.\n","publish_time":1586029404674,"_cnpm_publish_time":1586029404674,"dist-tags":{"latest":"5.0.1"}}