{"_id":"simple-eval","_rev":"8-a42f290925be75e022faef463df436eb","name":"simple-eval","dist-tags":{"latest":"2.0.1"},"versions":{"0.0.0":{"name":"simple-eval","version":"0.0.0","keywords":["eval","evaluation","code evaluation","code execution","ast"],"author":{"name":"Jakub Rożek"},"license":"MIT","_id":"simple-eval@0.0.0","maintainers":[{"name":"p0lip","email":"jakub@rozek.tech"}],"homepage":"https://github.com/P0lip/simple-eval","bugs":{"url":"https://github.com/P0lip/simple-eval/issues"},"dist":{"shasum":"b2936bc2a8cd71a1af240308b6eb147c8323ea49","tarball":"https://registry.npmjs.org/simple-eval/-/simple-eval-0.0.0.tgz","fileCount":6,"integrity":"sha512-mSWcjqvBK8IxF7Nf6vccs8w17+VuqYQMfBvnqQRVfvDFD7t0eOetw6tj3Nm6Kju97XF4Ty+/Tg4npFL2g2GONQ==","signatures":[{"sig":"MEUCIAg3fnQMJNa/miMecpnOIjS4i+34K14iBUJLIzBm4CP3AiEAy1e0vAUh07zAcbAlq/depf357fyeuLmHUcGaHG3yMxk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYPLICRA9TVsSAnZWagAAZz4P/09f+XcKAM3pGhES4cQS\nefazTidNcLX2Jq4k9S5vN5oG+B1MPHFrQoh5hVL9m3umxkVSMgx/Vtk9hCAg\nO+h/m7jUO1HngoD/qRQhkayyZj3fKV61l5LWnMmVKc2CI/ZTQoAYFvjk9xAL\n9P0862KEV4gtupDVfQOZXx4DyCJTI7Yim/AUpKHMGEXZxizQrL+R3Xtul7ej\nj4gIxNCspsTJs/KbgKk9Qi7YqnbHSUEbGggxCfMDeQoJ48RJv1FwWcclljYy\ntwgY3xpV22yZV3CflHtUtL8Xxabe/iVcDpE1vJwbAIcl3lQO8umUAoS8mt/b\nYzwTdtLn9rJhR6EbzTaQPWkVJhGcDbYHcL9rjIMzu+uEMtBLXmpDO5amQGEU\nW/3nzyQAg6CdnIN/b4IFW5IXv/fNsC8p9xQLMFe+BFBPuQUdXZVBkXAYNBq9\nYKqqCrZqNWn7tSIXolyNMrspA4qiyMowPE+S1sf3+4r6FVf08Yxj+kManRde\nIudsIY9RQdj0rLvw1icmnmmG6REH8JMZuQsFepW3YBoir8u7hIHVWDBBL+oz\n+sSTlfp/BUiItWvsTdTxVIrHEEQDX6rNM/LTH3Ay/8vZ1jU6tdhcadtHUKFS\nZM6530ReJSqOpersT86KBtgmS+HCCPJM/U5IJ8j3qasJCdEsKbRVIyo4JaGH\nTiVw\r\n=iCC4\r\n-----END PGP SIGNATURE-----\r\n"},"engines":{"node":">=12"},"exports":{"import":"./src/index.mjs","require":"./dist/index.cjs"},"gitHead":"e8cea08cf357d498d2f3e6de7ff1c92fa9e9695b","scripts":{"lint":"eslint --cache --cache-location .cache/ src/**/*.mjs","test":"cross-env NODE_ENV=test c8 mocha --experimental-modules --config .mocharc ./src/__tests__/*.mjs","build":"cross-env NODE_ENV=production rollup -c","prepublish":"npm run lint && npm run test && npm run build"},"typings":"./src/index.d.ts","_npmUser":{"name":"p0lip","email":"jakub@rozek.tech"},"repository":{"url":"git+https://github.com/P0lip/simple-eval.git","type":"git"},"_npmVersion":"7.0.15","description":"Simple JavaScript expression evaluator","directories":{},"_nodeVersion":"15.4.0","dependencies":{"jsep":"0.4.0"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^7.6.0","chai":"^4.3.4","husky":"^4.3.8","mocha":"^8.3.2","eslint":"^7.23.0","rollup":"^2.43.1","prettier":"^2.2.1","cross-env":"^7.0.3","mocha-each":"^2.0.1","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","eslint-plugin-chai-expect":"^2.2.0","eslint-plugin-chai-friendly":"^0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/simple-eval_0.0.0_1616966344083_0.7332629209157477","host":"s3://npm-registry-packages"}},"0.0.1":{"name":"simple-eval","version":"0.0.1","keywords":["eval","evaluation","code evaluation","code execution","ast"],"author":{"name":"Jakub Rożek"},"license":"MIT","_id":"simple-eval@0.0.1","maintainers":[{"name":"p0lip","email":"jakub@rozek.tech"}],"homepage":"https://github.com/P0lip/simple-eval","bugs":{"url":"https://github.com/P0lip/simple-eval/issues"},"dist":{"shasum":"0ac0c2cd12e1a0b08af885b770195672fe3bf107","tarball":"https://registry.npmjs.org/simple-eval/-/simple-eval-0.0.1.tgz","fileCount":8,"integrity":"sha512-UX0PcKxBAFmPsgndLUO6WhQdj7t33RKi6NmmFCM2MiMeZn/7qndFnMv80z9jfedQZs0D2DCe/XUVKddW4S6JMg==","signatures":[{"sig":"MEYCIQDEbT/cw/KjDs8Mjc2mTqf4GbiV25TFmulZKoOA5FlxLQIhALeMl5LGo74Mwfc9J6LbpYbL16scPbt7Ha0SOvv4jaxc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10614},"engines":{"node":">=12"},"exports":{"import":"./src/index.mjs","require":"./dist/index.cjs"},"gitHead":"e4b9bed364f461ce3ac2f1260fa328018130bdb3","scripts":{"lint":"eslint --cache --cache-location .cache/ src/**/*.mjs","test":"cross-env NODE_ENV=test c8 mocha --experimental-modules --config .mocharc ./src/__tests__/*.mjs","build":"cross-env NODE_ENV=production rollup -c","prepare":"husky install","prepublish":"npm run lint && npm run test && npm run build"},"typings":"./src/index.d.ts","_npmUser":{"name":"p0lip","email":"jakub@rozek.tech"},"repository":{"url":"git+https://github.com/P0lip/simple-eval.git","type":"git"},"_npmVersion":"8.1.0","description":"Simple JavaScript expression evaluator","directories":{},"_nodeVersion":"16.13.0","dependencies":{"jsep":"^1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^7.6.0","chai":"^4.3.4","husky":"^6.0.0","mocha":"^8.3.2","eslint":"^7.23.0","rollup":"^2.43.1","prettier":"^2.2.1","cross-env":"^7.0.3","mocha-each":"^2.0.1","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","eslint-plugin-chai-expect":"^2.2.0","eslint-plugin-chai-friendly":"^0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/simple-eval_0.0.1_1635373007601_0.9536242525567855","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"simple-eval","version":"1.0.0","keywords":["eval","evaluation","code evaluation","code execution","ast"],"author":{"name":"Jakub Rożek"},"license":"MIT","_id":"simple-eval@1.0.0","maintainers":[{"name":"p0lip","email":"jakub@rozek.tech"}],"homepage":"https://github.com/P0lip/simple-eval","bugs":{"url":"https://github.com/P0lip/simple-eval/issues"},"dist":{"shasum":"7ba8e6049840690b2d4e356ed01f13209e03aad1","tarball":"https://registry.npmjs.org/simple-eval/-/simple-eval-1.0.0.tgz","fileCount":8,"integrity":"sha512-kpKJR+bqTscgC0xuAl2xHN6bB12lHjC2DCUfqjAx19bQyO3R2EVLOurm3H9AUltv/uFVcSCVNc6faegR+8NYLw==","signatures":[{"sig":"MEUCIQCX1OzKvs2JOtG+jh/q6j5t2rykasFnAQzQakyRHtAgtAIgEuQTHCFeoLJsSNPCiTO3uYLYPslADYsbk0XAXHTBKS4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh27IvCRA9TVsSAnZWagAARG8P/j4KpqXuVk4wrriGxUJb\nptjJjtYUhHZ3t2aqAtkdbUdxmWBZcBg8mBBb2ddRltpunq+cBeNBjPeo2iz0\nfRwwNi/lbiV4HwViFWBxkYn4yeDL3TTI2JiFRt9xsEzGLMGpTmDd/IpthXoE\nGIpL3dHPOx8/HxdN7Uygiqt1KfFFMneN3t0UA/K9ufSw19L5k6ZoQ1rVkzJX\nClc8SdC8NNrjY9A90WYjEng/vi96WQxbK6exlK4usYTAxk1P8aYo1bjc5SB7\nY9pk31JtlDNv6FvCnF40zWufJSq7Y9RHkyCcvUHo1c/wG8qV+9ipfjgOkCbg\nmTk/rxqwAdazn2/yzK9J+Fwj+GEfRDFZDdZbZqjsVue99U13PLOC+l/vA8Ok\nOYr13WPuhLBY95UnEfhXbvGPiNOb3sW2PidkZPVvMw7lqTpvmrj9ZnXPMG+o\nbCCzTjOHRq1CsKgEJLzFBJ/Tqo+RMWu+VkDGWdgYHHy/Hy+K/6ZVbbHcgON4\nsYsefw5K0qMZm/Vv0DpzXnckuuZPVrLnV1tnElf292LyS67J2kQaCYYZNGmu\nOv9KiM/HUBpr3Vmc1/eFWgl032MvfBKKDGuqpgUGP4F210VS/WFzmEzQIr3g\nqUQaR08ecveP1EfKDzA9LAvVACzjcPKzdLr9nBj5+e9jSpbjzY0jCyF5kvb6\nyZDg\r\n=eOcW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","type":"commonjs","engines":{"node":">=12"},"exports":{".":{"import":"./src/index.mjs","require":"./dist/index.js"},"./eval":{"import":"./src/reduce.mjs","require":"./dist/reduce.js"}},"gitHead":"5ef0f66eed63b442860ee2e3c268d741b15a3cb4","scripts":{"lint":"eslint --cache --cache-location .cache/ src/**/*.mjs","test":"cross-env NODE_ENV=test c8 mocha --experimental-modules --config .mocharc ./src/__tests__/*.mjs","build":"cross-env NODE_ENV=production rollup -c","prepare":"husky install","prepublish":"npm run lint && npm run test && npm run build"},"typings":"./src/index.d.ts","_npmUser":{"name":"p0lip","email":"jakub@rozek.tech"},"repository":{"url":"git+https://github.com/P0lip/simple-eval.git","type":"git"},"_npmVersion":"8.1.0","description":"Simple JavaScript expression evaluator","directories":{},"_nodeVersion":"16.13.0","dependencies":{"jsep":"^1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^7.6.0","chai":"^4.3.4","husky":"^6.0.0","mocha":"^8.3.2","eslint":"^7.23.0","rollup":"^2.43.1","prettier":"^2.2.1","cross-env":"^7.0.3","mocha-each":"^2.0.1","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","eslint-plugin-chai-expect":"^2.2.0","eslint-plugin-chai-friendly":"^0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/simple-eval_1.0.0_1635374369157_0.9691878333350086","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"simple-eval","version":"1.0.1","keywords":["eval","evaluation","code evaluation","code execution","ast"],"author":{"name":"Jakub Rożek"},"license":"MIT","_id":"simple-eval@1.0.1","maintainers":[{"name":"p0lip","email":"jakub@rozek.tech"}],"homepage":"https://github.com/P0lip/simple-eval","bugs":{"url":"https://github.com/P0lip/simple-eval/issues"},"dist":{"shasum":"f91fc2b1583b7f5b972cdc088b769880087120a5","tarball":"https://registry.npmjs.org/simple-eval/-/simple-eval-1.0.1.tgz","fileCount":9,"integrity":"sha512-LH7FpTAkeD+y5xQC4fzS+tFtaNlvt3Ib1zKzvhjv/Y+cioV4zIuw4IZr2yhRLu67CWL7FR9/6KXKnjRoZTvGGQ==","signatures":[{"sig":"MEUCIB3uSHgiL5dW4ZLYSK6iPBsYYxfR96NpH0xomcci5MTBAiEAiT35XMG2kIiWYnjAWc8525UJMLNGfJUT8KOov+UKrk4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1BrmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpmeQ//UZBrZIqFivieSHHbch7KBpRnjy/PVl9i8LULJ1DVxqIwuA2k\r\ng3k32/fi6BLN9dpG+FuG0ido9iRUMGBcBVHrbc8NT43Tge1LIs8OQLJqlexQ\r\ns3rwba3Qx/Fey72+gtJzITYYywTOdtzDT8iOtidwgj4Ww0pOHFFS2/vWoetr\r\nzfS747eRSFBkqFw8WDikCgEEU+2X6QZRRvi0oVZ6Zx47cGh6WSrGmOqfxOb0\r\nM820zPDmhMlUjViAI/jdBm89GslELs1EdLR2dKzHkaqB1N4luY/Abk6glxHT\r\nWZ2mbt1hsyCXLKSN/TkQgUBhuXBHQmOQpg3E3otstn+06Zh8U+eZGeq8UkjX\r\nGq/Ux4KhNXR9Sos2pIO0D4XwfZ622u+AxcG9e1eVUwelQQEGDOyScRiAOcUR\r\nRbGBvQteW4RKK+DYKzR3SUdLmxaHmb4YOQJGpkfq5YHdJiAWhvypXwu4YqCg\r\nFWWbllYjm7tzxkW4lp31J/fccIvGWeIF7s/fjtZtAq66ytT6byo4KkRVAPaD\r\nN0lne0DiLQTLBj3MVEw4RwgoMlDO/ci4iIzdL+jAulTpWKbtM30Y107ahW4J\r\nGLiWiYEe47labzpa/pm9NRIsf4/LTdA+ETXYc6/atW9kh67GqJn+HaT/SYeq\r\n/e9pWR2djyvoJ9tXnwiV3sv23KWrEQnlMkM=\r\n=KuSM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","type":"commonjs","engines":{"node":">=12"},"exports":{".":{"types":"./src/index.d.ts","import":"./src/index.mjs","require":"./dist/index.js"},"./eval":{"types":"./src/reduce.d.ts","import":"./src/reduce.mjs","require":"./dist/reduce.js"}},"gitHead":"75aa4e24c5bbf97ae68f7722b87cd8a035c541b8","scripts":{"lint":"eslint --cache --cache-location .cache/ src/**/*.mjs","test":"cross-env NODE_ENV=test c8 mocha --config .mocharc ./src/__tests__/*.mjs","build":"cross-env NODE_ENV=production rollup -c","prepare":"husky install","prepublish":"npm run lint && npm run test && npm run build"},"typings":"./src/index.d.ts","_npmUser":{"name":"p0lip","email":"jakub@rozek.tech"},"repository":{"url":"git+https://github.com/P0lip/simple-eval.git","type":"git"},"_npmVersion":"8.11.0","description":"Simple JavaScript expression evaluator","directories":{},"_nodeVersion":"18.3.0","dependencies":{"jsep":"^1.3.6"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^7.11.3","chai":"^4.3.6","husky":"^6.0.0","mocha":"^10.0.0","eslint":"^8.20.0","espree":"^9.3.2","rollup":"^2.43.1","prettier":"^2.7.1","cross-env":"^7.0.3","mocha-each":"^2.0.1","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.2.1","eslint-plugin-chai-expect":"^3.0.0","eslint-plugin-chai-friendly":"^0.7.2"},"_npmOperationalInternal":{"tmp":"tmp/simple-eval_1.0.1_1658067686468_0.2768029250106967","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"simple-eval","version":"2.0.0","keywords":["eval","evaluation","code evaluation","code execution","ast"],"author":{"name":"Jakub Rożek"},"license":"MIT","_id":"simple-eval@2.0.0","maintainers":[{"name":"p0lip","email":"jakub@rozek.tech"}],"homepage":"https://github.com/P0lip/simple-eval","bugs":{"url":"https://github.com/P0lip/simple-eval/issues"},"dist":{"shasum":"805caedfbf56d7e171be69cd83a3d232b4171925","tarball":"https://registry.npmjs.org/simple-eval/-/simple-eval-2.0.0.tgz","fileCount":18,"integrity":"sha512-TILNUZtm2C4AGtdlFbu6T6tTFAGg3MV1B6pza6q7igfVdUm301aGCH8Bi99djne4mLH7s+Ks+pH6b0qgB8dYOQ==","signatures":[{"sig":"MEYCIQD5RsGh327lZZH5KeNi9VV82P8v03Y24zdfKx/anxtFfAIhAKaDzTxz+2JYehYTw4HFu5z8idnhGVJ7JOwgmNjmMU0H","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45629},"type":"module","module":"./dist/index.js","engines":{"node":">=12"},"exports":{".":"./dist/index.js","./eval":"./dist/reduce.js"},"gitHead":"01d4789cb298c00dddc9bf12263de85fbb0839de","scripts":{"lint":"eslint --cache --cache-location .cache/ src && prettier --check src","test":"node --experimental-strip-types --experimental-test-coverage  --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=coverage/lcov.info --test-coverage-lines=90 --test-coverage-branches=95 --test ./src/__tests__/*.ts","build":"tsup","prepare":"husky install","typecheck":"tsc --noEmit","prepublishOnly":"node --run lint && node --run test && node --run typecheck && node --run build"},"typings":"./dist/index.d.ts","_npmUser":{"name":"p0lip","email":"jakub@rozek.tech"},"repository":{"url":"git+https://github.com/P0lip/simple-eval.git","type":"git"},"_npmVersion":"10.9.2","description":"Simple JavaScript expression evaluator","directories":{},"_nodeVersion":"22.15.0","dependencies":{"jsep":"^1.4.0","@types/estree":"^1.0.7"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","husky":"^6.0.0","eslint":"^9.27.0","espree":"^9.3.2","prettier":"^3.5.3","typescript":"^5.8.3","@types/node":"^22.15.27","@types/espree":"^10.1.0","@typescript-eslint/parser":"^8.33.0","@typescript-eslint/eslint-plugin":"^8.33.0"},"_npmOperationalInternal":{"tmp":"tmp/simple-eval_2.0.0_1748617687518_0.40957784925321516","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"simple-eval","version":"2.0.1","description":"Simple JavaScript expression evaluator","keywords":["eval","evaluation","code evaluation","code execution","ast"],"homepage":"https://github.com/P0lip/simple-eval","bugs":{"url":"https://github.com/P0lip/simple-eval/issues"},"engines":{"node":">=12"},"typings":"./dist/index.d.ts","type":"module","module":"./dist/index.js","exports":{".":"./dist/index.js","./eval":"./dist/reduce.js"},"license":"MIT","author":{"name":"Jakub Rożek"},"repository":{"type":"git","url":"git+https://github.com/P0lip/simple-eval.git"},"scripts":{"build":"tsup","typecheck":"tsc --noEmit","lint":"eslint --cache --cache-location .cache/ src && prettier --check src","test":"node --experimental-strip-types --experimental-test-coverage  --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=coverage/lcov.info --test-coverage-lines=90 --test-coverage-branches=95 --test ./src/__tests__/*.ts","prepublishOnly":"node --run lint && node --run test && node --run typecheck && node --run build","prepare":"husky install"},"dependencies":{"@types/estree":"^1.0.7","jsep":"^1.4.0"},"devDependencies":{"@types/espree":"^10.1.0","@types/node":"^22.15.27","@typescript-eslint/eslint-plugin":"^8.33.0","@typescript-eslint/parser":"^8.33.0","eslint":"^9.27.0","espree":"^9.3.2","husky":"^6.0.0","prettier":"^3.5.3","tsup":"^8.5.0","typescript":"^5.8.3"},"gitHead":"60383e7b793b729fa74be737445ae4009117736d","_id":"simple-eval@2.0.1","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-FD3km51AM1i+Kyk5mMUzR7PpgyPa1+/4olY0ReCM5u9lNpDUbcmRRYJ1Nq1gMyBFuJfnjBLt7vfGSLM7zgOh9A==","shasum":"6a62d4ef4d9115e6bb39f0471c372cd65a6cb201","tarball":"https://registry.npmjs.org/simple-eval/-/simple-eval-2.0.1.tgz","fileCount":18,"unpackedSize":47606,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGnXzpMARndtAQ0xKl58614AlHDyUBFLClbeWh/YdbhxAiAj1BhdVJRmeQphlmfwp4NUTHBklmt1QY3tEAUFYrqNAA=="}]},"_npmUser":{"name":"p0lip","email":"jakub@rozek.tech"},"directories":{},"maintainers":[{"name":"p0lip","email":"jakub@rozek.tech"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/simple-eval_2.0.1_1781095215782_0.3149356011426032"},"_hasShrinkwrap":false}},"time":{"created":"2021-03-28T21:19:04.082Z","modified":"2026-06-10T12:40:16.108Z","0.0.0":"2021-03-28T21:19:04.262Z","0.0.1":"2021-10-27T22:16:47.801Z","1.0.0":"2021-10-27T22:39:29.305Z","1.0.1":"2022-07-17T14:21:26.654Z","2.0.0":"2025-05-30T15:08:07.682Z","2.0.1":"2026-06-10T12:40:15.970Z"},"bugs":{"url":"https://github.com/P0lip/simple-eval/issues"},"author":{"name":"Jakub Rożek"},"license":"MIT","homepage":"https://github.com/P0lip/simple-eval","keywords":["eval","evaluation","code evaluation","code execution","ast"],"repository":{"type":"git","url":"git+https://github.com/P0lip/simple-eval.git"},"description":"Simple JavaScript expression evaluator","maintainers":[{"name":"p0lip","email":"jakub@rozek.tech"}],"readme":"# simple-eval\n\nSimple JavaScript expression evaluator.\n\n## Install\n\n```sh\nyarn add simple-eval\n```\n\nor if npm is package manager of your choice\n\n```sh\nnpm install simple-eval --save\n```\n\n## Usage\n\n```js\nimport simpleEval from 'simple-eval';\n\nsimpleEval('2 + 4 * 10 + -4'); //  38\nsimpleEval('Math.floor(Math.PI * 10)'); // exception \nsimpleEval('Math.floor(Math.PI * 10)', { Math }); // 31, works because we provided Math\nsimpleEval('foo.bar.baz ? 10 : Math.random()', {\n  Math,\n  foo: {\n    bar: {\n      baz: false,\n    }\n  }\n}); // some random number, as returned by Math.random()\n```\n\nBy default, `simple-eval` uses [`jsep`](https://www.npmjs.com/package/jsep),\nbut you're free to use any ESTree compliant parser such as [`acorn`](https://www.npmjs.com/package/acorn), [`@babel/parser`](https://www.npmjs.com/package/@babel/parser), or [`esprima`](https://www.npmjs.com/package/esprima).\n\n## Security\n\n> [!WARNING]\n> **`simple-eval` is not a sandbox.** Do not use it to evaluate untrusted input.\n\nThe library supports a deliberately limited subset of JavaScript expressions — all declarations and assignments are prohibited, and access to `constructor`, `__proto__`, and `prototype` is blocked to prevent the classic `(1).constructor.constructor(\"…\")()` escape to the `Function` constructor.\n\nThese restrictions make it safer than a bare `eval`, but they are **best-effort hardening, not a security boundary**. Anything you pass in via the context object is fully reachable by the evaluated expression, and the JavaScript engine offers many other avenues for escape. If you need to run untrusted code, use a real sandbox (a separate process, a VM/isolate, or a WebAssembly boundary) — not this library.\n\n## Caveats\n\nThis library does not aim to be a drop-in replacement for `eval`; it intentionally supports only a small set of instructions.\n\n## LICENSE\n\n[MIT](https://github.com/P0lip/simple-eval/blob/master/LICENSE)\n","readmeFilename":"README.md"}