{"name":"expression-eval","version":"4.0.0","description":"JavaScript expression parsing and evaluation.","source":"index.ts","main":"dist/expression-eval.js","module":"dist/expression-eval.module.js","unpkg":"dist/expression-eval.umd.js","types":"dist/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 | tap-spec","preversion":"npm run build && npm test","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":{"@types/tape":"^4.13.0","@typescript-eslint/eslint-plugin":"^4.12.0","eslint":"^7.17.0","microbundle":"^0.13.0","source-map-support":"^0.5.19","tap-spec":"^5.0.0","tape":"^5.1.1","typescript":"^4.1.3"},"gitHead":"1b3f601e02acf2867ef0896ba66f876b5746c0f3","bugs":{"url":"https://github.com/donmccurdy/expression-eval/issues"},"homepage":"https://github.com/donmccurdy/expression-eval#readme","_id":"expression-eval@4.0.0","_nodeVersion":"12.9.1","_npmVersion":"6.14.9","dist":{"integrity":"sha512-YHSnLTyIb9IKaho2IdQbvlei/pElxnGm48UgaXJ1Fe5au95Ck0R9ftm6rHJQuKw3FguZZ4eXVllJFFFc7LX0WQ==","shasum":"d6a07c93e8b33e635710419d4a595d9208b9cc5e","tarball":"http://registry-npm.ywwl.com/expression-eval/download/expression-eval-4.0.0.tgz","fileCount":13,"unpackedSize":341278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9S4PCRA9TVsSAnZWagAAwxkP/R0+M+60cOb1jt+tUho1\ngYGH0GEDis1VWJJMOKnPMbuP+X0YNFwArFl9R/DRPny+WdgQCw7T7f6kMoYf\nxaz+PrWDi15rnPNJ98xj16M5u3aVcofzh0Lc4ep6v2D7YLQGmQFfXplk7BhJ\nmngxft4pwaX+KaLD4OZLk/nD6CJT1hx41DD9wrlGt0c/p3akQuO2nNvnF/vK\nFf1dX24JAeayYT5p8IAqUcU+P4qessbILuMXCTQNW3OEGX5Nk35G0WdhjJa3\nfKzmMSBBp+J0aZ1QLBeiZIRgVAu6ZlPv8Hus5kqdjcQ/rBE78gNdTzqYNvbU\nQGCdwMxGweEREaf3P693xHvqbiAhriCsKlPqP9kW/cXynBTNMBPP5iGatDtq\ncN3FW8RubdY6Je2x85cg34kEsfGXo+2CaaBaOts5gztwXj4bXERTfZMJPE1F\n+ynwpBNz/EiT3SQK2O2qGeh5ysRY6Xs3PzB5PKXwgpuCNMSStaFAJHFFnITK\n1UukCkU2DXpA/Y/+BkRH8dz8Ho24MgciLyWkaAT2EqGugVWezgYNvv+smaUL\n8l9kLBXPsJQslNnEwLKzWkXJaY+sNIqsimeLNDN3gMVi1zTcZrfkzULf3NER\nya9xbzl5phVQFBuAxxXGO2rxqRvWNtq6hY8ci5IoVgWqZfE+QAlx+gVPiXIT\n3yQk\r\n=RGQ+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHaWeJ3c6iPIhfcw13gwRqS31NiHE5OT4DFLz1Bw7JZXAiEAyfbvKj8+rjrOQsUP7Sc/Ps5F1NNDL208mUZ0912+dNY="}],"size":70796,"noattachment":false,"key":"/expression-eval/-/expression-eval-4.0.0.tgz"},"_npmUser":{"name":"donmccurdy","email":"dm@donmccurdy.com"},"directories":{},"maintainers":[{"name":"donmccurdy","email":"dm@donmccurdy.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/expression-eval_4.0.0_1609903631306_0.5065058947538144"},"_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":1609903631417,"_cnpm_publish_time":1609903631417,"dist-tags":{"latest":"5.0.1"}}