{"name":"expression-eval","version":"1.2.2","description":"JavaScript expression parsing and evaluation, safely.","main":"index.js","scripts":{"dev":"budo browser.js:bundle.js","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":{"budo":"^10.0.4"},"gitHead":"6988aa77de621f0f17fea94b1d3076147d0c6c03","_id":"expression-eval@1.2.2","_npmVersion":"5.8.0","_nodeVersion":"6.9.5","_npmUser":{"name":"donmccurdy","email":"dm@donmccurdy.com"},"dist":{"integrity":"sha512-9kdj4eW6S+vtaTERxNO+TQM1bKms9NsvTTEAKLLPNhH/HVmmj/NT9eYH4xUAwr70GTJIaudTMbdrlRS+mKoQEg==","shasum":"df42478f4f230f1cca20078a8bd382cf45c329fe","tarball":"http://registry-npm.ywwl.com/expression-eval/download/expression-eval-1.2.2.tgz","fileCount":6,"unpackedSize":9313,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6ANeCRA9TVsSAnZWagAAsoIP/iXbY2KRqSC73l/sn8/z\niDM+yUYlW/twJYfG+iRK8asxX6W+wc1eZYA/6XVNHBvYwguCuJB7FnjW/NiK\nqpNh1PxgCwZM+rI4wfiLDcvtrPCiU6IpKIBI2ckzu7rC3VDQcZCEocl9NK6R\nsw3Kx2TDuOTIfUv6I3dq+AChqX1//G3dMVY4yIHQ6TRJMa1Af5bcG0P7DEUT\nDbWglEWKKpZmgCEs6ENLKMdbp5TPDbTev6aHG1e5yAEth0r5eL3oMUk3FOJO\n1+XUBwSDgni9D3f54fvT5DlVn4G8tpypTr4vAKU7qI9PpN/hNkopYqHPu73K\n7RGzRjktIO1iKwzDxJR+O4N/ttWWevNq4R4MpPUQOhRqLtAg260SZQaEee5r\nOlSBsA7luxeBg1En8x+QY2414q1meuU9JvVTgqkjOEnti6jIgiWVSrdxATjm\nNgQKNR+u7mpUD9GFF5y/E2uCLnAG8wGab3ITnkVtaObkO5dd5KqjztP1LjDW\nMabCQtZCukQRaKScQf94j4PYu97nPz77e8Q4eOALhqIR6hWwlhxHmSvzPMG4\npZNxP2qWwoNWTVgM+KWSUhc6+i7z+lT0UbiIHXh8rjrz4If1xnFiwZdkCSQI\nC55W3/h4vEIo7gcbYwoCmaoZxobb8h2ztK95YM9MKqJBccicpAz0goG6wZJO\nBYf/\r\n=DDun\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEwiIfw9vCPXvrUXIeqHq7GmDlX2bpg9CpxofEoGRDOYAiBMeesnf/Tu1nNosTbpiFPHzKBm5HArR/5n9/22GonTiQ=="}],"size":3384,"noattachment":false,"key":"/expression-eval/-/expression-eval-1.2.2.tgz"},"maintainers":[{"name":"donmccurdy","email":"dm@donmccurdy.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/expression-eval_1.2.2_1525154653122_0.3176425647920176"},"_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":1525154653204,"_cnpm_publish_time":1525154653204,"dist-tags":{"latest":"5.0.1"}}