{
  "manifest": {
    "name": "static-eval",
    "version": "2.0.2",
    "description": "evaluate statically-analyzable expressions",
    "main": "index.js",
    "dependencies": {
      "escodegen": "^1.8.1"
    },
    "devDependencies": {
      "esprima": "^2.7.3",
      "tape": "^4.6.0"
    },
    "scripts": {
      "test": "tape test/*.js"
    },
    "testling": {
      "files": "test/*.js",
      "browsers": [
        "ie/8..latest",
        "ff/latest",
        "chrome/latest",
        "opera/latest",
        "safari/latest"
      ]
    },
    "repository": {
      "type": "git",
      "url": "git://github.com/substack/static-eval.git"
    },
    "homepage": "https://github.com/substack/static-eval",
    "keywords": [
      "static",
      "eval",
      "expression",
      "esprima",
      "ast",
      "abstract",
      "syntax",
      "tree",
      "analysis"
    ],
    "author": {
      "name": "James Halliday",
      "email": "mail@substack.net",
      "url": "http://substack.net"
    },
    "license": "MIT",
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-static-eval-2.0.2-2d1759306b1befa688938454c546b7871f806a42-integrity/node_modules/static-eval/package.json",
    "readmeFilename": "readme.markdown",
    "readme": "# static-eval\n\nevaluate statically-analyzable expressions\n\n[![testling badge](https://ci.testling.com/substack/static-eval.png)](https://ci.testling.com/substack/static-eval)\n\n[![build status](https://secure.travis-ci.org/substack/static-eval.png)](http://travis-ci.org/substack/static-eval)\n\n# security\n\nstatic-eval is like `eval`. It is intended for use in build scripts and code transformations, doing some evaluation at build time—it is **NOT** suitable for handling arbitrary untrusted user input. Malicious user input _can_ execute arbitrary code.\n\n# example\n\n``` js\nvar evaluate = require('static-eval');\nvar parse = require('esprima').parse;\n\nvar src = process.argv[2];\nvar ast = parse(src).body[0].expression;\n\nconsole.log(evaluate(ast));\n```\n\nIf you stick to simple expressions, the result is statically analyzable:\n\n```\n$ node '7*8+9'\n65\n$ node eval.js '[1,2,3+4*5-(5*11)]'\n[ 1, 2, -32 ]\n```\n\nbut if you use statements, undeclared identifiers, or syntax, the result is no\nlonger statically analyzable and `evaluate()` returns `undefined`:\n\n```\n$ node eval.js '1+2+3*n'\nundefined\n$ node eval.js 'x=5; x*2'\nundefined\n$ node eval.js '5-4*3'\n-7\n```\n\nYou can also declare variables and functions to use in the static evaluation:\n\n``` js\nvar evaluate = require('static-eval');\nvar parse = require('esprima').parse;\n\nvar src = '[1,2,3+4*10+n,foo(3+5),obj[\"\"+\"x\"].y]';\nvar ast = parse(src).body[0].expression;\n\nconsole.log(evaluate(ast, {\n    n: 6,\n    foo: function (x) { return x * 100 },\n    obj: { x: { y: 555 } }\n}));\n```\n\n# methods\n\n``` js\nvar evaluate = require('static-eval');\n```\n\n## evaluate(ast, vars={})\n\nEvaluate the [esprima](https://npmjs.org/package/esprima)-parsed abstract syntax\ntree object `ast` with an optional collection of variables `vars` to use in the\nstatic expression resolution.\n\nIf the expression contained in `ast` can't be statically resolved, `evaluate()`\nreturns undefined.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install static-eval\n```\n\n# license\n\nMIT\n",
    "licenseText": "This software is released under the MIT license:\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/static-eval/-/static-eval-2.0.2.tgz#2d1759306b1befa688938454c546b7871f806a42",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/static-eval/-/static-eval-2.0.2.tgz",
    "hash": "2d1759306b1befa688938454c546b7871f806a42",
    "integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==",
    "registry": "npm",
    "packageName": "static-eval",
    "cacheIntegrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg== sha1-LRdZMGsb76aIk4RUxUa3hx+AakI="
  },
  "registry": "npm",
  "hash": "2d1759306b1befa688938454c546b7871f806a42"
}