{"name":"expression-eval","version":"3.0.1","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","typings":"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","preversion":"npm run 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":{"microbundle":"^0.11.0"},"gitHead":"332e1cb0a025427757317acb2c67421f61a165f7","bugs":{"url":"https://github.com/donmccurdy/expression-eval/issues"},"homepage":"https://github.com/donmccurdy/expression-eval#readme","_id":"expression-eval@3.0.1","_nodeVersion":"13.12.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-7rveYMYmdehRtd2v7+CjKdrnUIYr1RakGJCNOrXi3NsEFJdR++GJoJ3zzH7A76ZgbcNlecLL6WSQosToHxbvsw==","shasum":"ef98f6eb765c589fa507478be4beaac3d646b161","tarball":"http://registry-npm.ywwl.com/expression-eval/download/expression-eval-3.0.1.tgz","fileCount":13,"unpackedSize":58178,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegPwBCRA9TVsSAnZWagAABJQQAJjt5NdXU2FT4M4IK8b8\nBT2cwDwwOhOAYU6BuATttDFNmqtg61UHZFYLspubcEe7WqhlrHSGIUpjibqk\n8Slz6lGhYShA3OIib/+HzqBsBEM8zL/GteaciuQtR+GeOmzkEQucBPyt4ytb\n3j1zxLVLj0WrkU3lzvab63Z0mNTovzjBd59KDfv3lpRj2P2tSs5/7AGgt6jC\n5PL53Ii7icMZj6Wrx2fnpCmO71L2Ps0TuIv3+4OM/nflJkAoAccVlLHemeIG\niufUPIY7sYHN3xNqwU3G1eXTyRLBCy89lzooqZt3q53aT1g92XzrZC2uWVST\nHwJzOMFT1o0q5abzmav0kRdQz4QFupVe3g0KSKJEI+ZZTgUZgdBd2ZBm4ldv\nGxdvsVfOAN5HBVPCFtMumiSp63ZuAF5D0d/DhlloAgGX/geBKSYw/Xawz4Xz\n1o3a96Vq9L8jWQQbDxvfwvvsIvrhvU7u1hmxZ7yV/WwQC9G5AlNM3v0LXUKe\niz/cpxIuii7rKnqR/Z75NnbTjB7/sztXfujiM5ez4c4wRf2xMfHVbSSzO/Ok\nLj+dExFPASQ2qJHmpgfz8JSbCdX0ZPHVA/xlha97XnNsEL0MarwV7UJeESCu\n1rrMLpR3I8s09dQzHGYEtf4exvVeYhj5MWp6qu0Q+ESprgBlNO+bwF3x/IvT\nU24y\r\n=wJQk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2BRAajC2B5SugsYpzBsK4+g9LMZT/dSgEYX/ACcw2bgIgG6lEf2ardFbnvuvAd3rqyI92ridHs7p1rxYffizHk78="}],"size":8714,"noattachment":false,"key":"/expression-eval/-/expression-eval-3.0.1.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.0.1_1585511425302_0.6301563465247759"},"_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":1585511425582,"_cnpm_publish_time":1585511425582,"dist-tags":{"latest":"5.0.1"}}