{"_id":"safe-expr-eval","_rev":"5-a038a1ae986d5da05f163c52ea619ec2","name":"safe-expr-eval","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"safe-expr-eval","version":"1.0.0","keywords":["expression","parser","evaluator","security","safe","expr-eval","replacement","no-eval","secure-parser","expression-evaluator","boolean-logic","condition-parser"],"author":{"name":"Alejandro Castrillon"},"license":"MIT","_id":"safe-expr-eval@1.0.0","maintainers":[{"name":"acastrillon","email":"alejo12555@gmail.com"}],"homepage":"https://github.com/alecasg555/safe-expr-eval#readme","bugs":{"url":"https://github.com/alecasg555/safe-expr-eval/issues"},"dist":{"shasum":"ef22fb5749801c500de3c49d13816d2603c00140","tarball":"https://registry.npmjs.org/safe-expr-eval/-/safe-expr-eval-1.0.0.tgz","fileCount":24,"integrity":"sha512-ZjcohBoON2u6JCdbbW2mOvgnkaFLEJo82kK7yFF/7iZYMw+66npsPd7z8Cwkb6nwwPbL6SGE8r+tFQzY1LIH2A==","signatures":[{"sig":"MEUCIQDFZEjrrHpRJD3owHtu/zBBg1iZ1xI9ksGzcAz+SorvjQIgNzmNJOLiY2wPe75YMWnM2zf29IOznyJ/9xVZLByFwqI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52576},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=14.0.0"},"scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"tsc","format":"prettier --write \"src/**/*.ts\"","test:coverage":"jest --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"acastrillon","email":"alejo12555@gmail.com"},"repository":{"url":"git+https://github.com/alecasg555/safe-expr-eval.git","type":"git"},"_npmVersion":"11.6.2","description":"Secure expression evaluator - Drop-in replacement for expr-eval without CVE-2025-12735 vulnerability","directories":{},"_nodeVersion":"24.11.1","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0","ts-jest":"^29.0.0","prettier":"^3.0.0","typescript":"^5.0.0","@types/jest":"^29.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/safe-expr-eval_1.0.0_1764257169509_0.20401865526626173","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"safe-expr-eval","version":"1.0.1","keywords":["expression","parser","evaluator","security","safe","expr-eval","replacement","no-eval","secure-parser","expression-evaluator","boolean-logic","condition-parser"],"author":{"name":"Alejandro Castrillon"},"license":"MIT","_id":"safe-expr-eval@1.0.1","maintainers":[{"name":"acastrillon","email":"alejo12555@gmail.com"}],"homepage":"https://github.com/alecasg555/safe-expr-eval#readme","bugs":{"url":"https://github.com/alecasg555/safe-expr-eval/issues"},"dist":{"shasum":"452e5c042541e3fada1e8d4233ee7e5162f41bf8","tarball":"https://registry.npmjs.org/safe-expr-eval/-/safe-expr-eval-1.0.1.tgz","fileCount":24,"integrity":"sha512-L6n1Kg9y83orGwEhZOzgpsCUMKypLT9KR0ZwEFeYT0ZKn5/8bU/8zXkjihmT70vVLo02bY8Wy4YbOssoDm6GNQ==","signatures":[{"sig":"MEUCIQCM+XoFpHusq6K82h2U5s8Ro+VWptBYaFf0JOljIIfS4QIgI/Oosa+e0oNVXBpRVCtpxAmyBOw6EuBxEByc8zoNp1c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":51054},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=14.0.0"},"scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"tsc","format":"prettier --write \"src/**/*.ts\"","test:coverage":"jest --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"acastrillon","email":"alejo12555@gmail.com"},"repository":{"url":"git+https://github.com/alecasg555/safe-expr-eval.git","type":"git"},"_npmVersion":"11.13.0","description":"Secure expression evaluator - Drop-in replacement for expr-eval without CVE-2025-12735 vulnerability","directories":{},"_nodeVersion":"24.16.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0","ts-jest":"^29.0.0","prettier":"^3.0.0","typescript":"^5.0.0","@types/jest":"^29.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/safe-expr-eval_1.0.1_1779728439393_0.3637871877107246","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"safe-expr-eval","version":"1.0.2","keywords":["expression","parser","evaluator","security","safe","expr-eval","replacement","no-eval","secure-parser","expression-evaluator","boolean-logic","condition-parser"],"author":{"name":"Alejandro Castrillon"},"license":"MIT","_id":"safe-expr-eval@1.0.2","maintainers":[{"name":"acastrillon","email":"alejo12555@gmail.com"}],"homepage":"https://github.com/alecasg555/safe-expr-eval#readme","bugs":{"url":"https://github.com/alecasg555/safe-expr-eval/issues"},"dist":{"shasum":"eb40da7d24ecac0092a28485ea33aaff10a281ea","tarball":"https://registry.npmjs.org/safe-expr-eval/-/safe-expr-eval-1.0.2.tgz","fileCount":24,"integrity":"sha512-G6BJJp4hOhr6wjViZjQd4iNvYv5KFDALvf4dJVwuqCbdJ0oV8TsJKk0KZjgKman/XJHxQNCodZUYs19elT9iXQ==","signatures":[{"sig":"MEUCIG89+WqU7fiu4NKsjDzzYd4+DVMSkloZE2zQ85sOXNeyAiEAqkRku2c7rPcvooXI232UpobIocjj/CnhWAWwoxqDZiE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":51054},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=14.0.0"},"scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"tsc","format":"prettier --write \"src/**/*.ts\"","test:coverage":"jest --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"acastrillon","email":"alejo12555@gmail.com"},"repository":{"url":"git+https://github.com/alecasg555/safe-expr-eval.git","type":"git"},"_npmVersion":"11.13.0","description":"Secure expression evaluator - Drop-in replacement for expr-eval without CVE-2025-12735 vulnerability","directories":{},"_nodeVersion":"24.16.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0","ts-jest":"^29.0.0","prettier":"^3.0.0","typescript":"^5.0.0","@types/jest":"^29.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/safe-expr-eval_1.0.2_1779728565233_0.1512593687184749","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"safe-expr-eval","version":"1.0.3","keywords":["expression","parser","evaluator","security","safe","expr-eval","replacement","no-eval","secure-parser","expression-evaluator","boolean-logic","condition-parser"],"author":{"name":"Alejandro Castrillon"},"license":"MIT","_id":"safe-expr-eval@1.0.3","maintainers":[{"name":"acastrillon","email":"alejo12555@gmail.com"}],"homepage":"https://github.com/alecasg555/safe-expr-eval#readme","bugs":{"url":"https://github.com/alecasg555/safe-expr-eval/issues"},"dist":{"shasum":"92348d90930171f524016ae384c2afb62abdaa35","tarball":"https://registry.npmjs.org/safe-expr-eval/-/safe-expr-eval-1.0.3.tgz","fileCount":24,"integrity":"sha512-uxGG2Ht+nzYLLCxgkUNA1Y+O1xLIElCvYVUBCZRnR/Xc6o0fmasmRceVLx+qeVJ5D1onCemN7DrYzPtzN6P7tg==","signatures":[{"sig":"MEUCIEjb2XPCO3wTVHVAIx5qU4RPmBTAwgQ4ueasijEcAFlVAiEAmfhwjwOB0PtttNHuDHKCQysuECjrNpR4e7IARYG3TfA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":51054},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=14.0.0"},"scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"tsc","format":"prettier --write \"src/**/*.ts\"","test:coverage":"jest --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"acastrillon","email":"alejo12555@gmail.com"},"repository":{"url":"git+https://github.com/alecasg555/safe-expr-eval.git","type":"git"},"_npmVersion":"11.13.0","description":"Secure expression evaluator - Drop-in replacement for expr-eval without CVE-2025-12735 vulnerability","directories":{},"_nodeVersion":"24.16.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0","ts-jest":"^29.0.0","prettier":"^3.0.0","typescript":"^5.0.0","@types/jest":"^29.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/safe-expr-eval_1.0.3_1779728746334_0.700645241372061","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"safe-expr-eval","version":"1.0.4","description":"Secure expression evaluator - Drop-in replacement for expr-eval without CVE-2025-12735 vulnerability","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"jest","test:coverage":"jest --coverage","prepublishOnly":"npm run build && npm test","lint":"eslint src --ext .ts","format":"prettier --write \"src/**/*.ts\""},"keywords":["expression","parser","evaluator","security","safe","expr-eval","replacement","no-eval","secure-parser","expression-evaluator","boolean-logic","condition-parser"],"author":{"name":"Alejandro Castrillon"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/alecasg555/safe-expr-eval.git"},"bugs":{"url":"https://github.com/alecasg555/safe-expr-eval/issues"},"homepage":"https://github.com/alecasg555/safe-expr-eval#readme","engines":{"node":">=14.0.0"},"devDependencies":{"@types/jest":"^29.0.0","@types/node":"^20.0.0","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","eslint":"^8.0.0","jest":"^29.0.0","prettier":"^3.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0"},"peerDependencies":{},"dependencies":{},"_id":"safe-expr-eval@1.0.4","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-p6ILL9oYItu8Dqm7atFCq3JXW/S1AcZDXQMHRhkRIGpF96SIwEpzogjVNM87mCg+6rfz3Q//rwn1zH2EW2TQ/Q==","shasum":"3694739b3eb42b906417b94a5e6a74f3c21041b5","tarball":"https://registry.npmjs.org/safe-expr-eval/-/safe-expr-eval-1.0.4.tgz","fileCount":24,"unpackedSize":51054,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIH76I5xuQK6VrRL6AZ+wlstI6AM55CpFDztkPZ+6Wa8aAiEAuWJ36ahpjKeKu/kx+17gX/e/7InwiUA/NqUM4stpJjo="}]},"_npmUser":{"name":"acastrillon","email":"alejo12555@gmail.com"},"directories":{},"maintainers":[{"name":"acastrillon","email":"alejo12555@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/safe-expr-eval_1.0.4_1779728923409_0.4635170325757012"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-27T15:26:09.508Z","modified":"2026-05-25T17:08:43.690Z","1.0.0":"2025-11-27T15:26:09.772Z","1.0.1":"2026-05-25T17:00:39.540Z","1.0.2":"2026-05-25T17:02:45.404Z","1.0.3":"2026-05-25T17:05:46.476Z","1.0.4":"2026-05-25T17:08:43.564Z"},"bugs":{"url":"https://github.com/alecasg555/safe-expr-eval/issues"},"author":{"name":"Alejandro Castrillon"},"license":"MIT","homepage":"https://github.com/alecasg555/safe-expr-eval#readme","keywords":["expression","parser","evaluator","security","safe","expr-eval","replacement","no-eval","secure-parser","expression-evaluator","boolean-logic","condition-parser"],"repository":{"type":"git","url":"git+https://github.com/alecasg555/safe-expr-eval.git"},"description":"Secure expression evaluator - Drop-in replacement for expr-eval without CVE-2025-12735 vulnerability","maintainers":[{"name":"acastrillon","email":"alejo12555@gmail.com"}],"readme":"# safe-expr-eval\n\nFast and lightweight expression evaluator for JavaScript and TypeScript.\n\nA modern expression parser with a familiar API, zero dependencies, and full TypeScript support.\n\n---\n\n## Features\n\n* Fast expression parsing and evaluation\n* Lightweight and dependency-free\n* Full TypeScript support\n* Simple and familiar API\n* Custom functions and constants\n* ES2020+ compatible\n* Well tested\n\n---\n\n## Installation\n\n```bash\nnpm install safe-expr-eval\n```\n\n---\n\n# Quick Start\n\n## Basic Usage\n\n```ts\nimport { Parser } from 'safe-expr-eval';\n\nconst parser = new Parser();\nconst expr = parser.parse('2 * x + 1');\n\nconsole.log(expr.evaluate({ x: 3 })); // 7\nconsole.log(expr.evaluate({ x: 10 })); // 21\n```\n\n---\n\n## Direct Evaluation\n\n```ts\nimport { evaluate } from 'safe-expr-eval';\n\nconst result = evaluate('10 + 5 * 2');\n\nconsole.log(result); // 20\n```\n\n---\n\n## Compiled Expressions\n\n```ts\nimport { compile } from 'safe-expr-eval';\n\nconst fn = compile('price * quantity * (1 - discount)');\n\nconsole.log(\n  fn({\n    price: 100,\n    quantity: 2,\n    discount: 0.1\n  })\n); // 180\n```\n\n---\n\n# Supported Operations\n\n## Arithmetic\n\n```txt\n+  -  *  /  %\n```\n\n## Comparison\n\n```txt\n==  !=  >  <  >=  <=\n```\n\n## Logical\n\n```txt\nand  or  not\n&&   ||   !\n```\n\n---\n\n# Data Types\n\n```txt\nNumbers   → 42, 3.14\nStrings   → \"hello\"\nBooleans  → true, false\nVariables → price, user.name\n```\n\n---\n\n# Custom Functions\n\n```ts\nconst parser = new Parser();\n\nparser.functions.max = Math.max;\nparser.functions.min = Math.min;\nparser.functions.round = Math.round;\n\nconst expr = parser.parse(\n  'round(max(a, b) * 1.5)'\n);\n\nconsole.log(\n  expr.evaluate({\n    a: 10,\n    b: 20\n  })\n); // 30\n```\n\n---\n\n# Constants\n\n```ts\nconst parser = new Parser();\n\nparser.consts.PI = Math.PI;\nparser.consts.TAX_RATE = 0.15;\n\nconst expr = parser.parse(\n  'price * (1 + TAX_RATE)'\n);\n\nconsole.log(\n  expr.evaluate({\n    price: 100\n  })\n); // 115\n```\n\n---\n\n# API\n\n## Parser\n\n### Create parser\n\n```ts\nnew Parser()\n```\n\n### Parse expression\n\n```ts\nparser.parse(expression)\n```\n\n### Evaluate expression\n\n```ts\nparser.evaluate(expression, variables?)\n```\n\n### Functions registry\n\n```ts\nparser.functions\n```\n\n### Constants registry\n\n```ts\nparser.consts\n```\n\n---\n\n# Standalone Functions\n\n## evaluate\n\n```ts\nevaluate(expression, variables?)\n```\n\n## compile\n\n```ts\ncompile(expression)\n```\n\n---\n\n# Testing\n\n```bash\nnpm test\n```\n\n```bash\nnpm run test:coverage\n```\n\n---\n\n# License\n\nMIT\n\nSee the LICENSE file for details.\n\n---\n\n# Contributing\n\nPull requests and contributions are welcome.\n\n---\n\n# Issues\n\nPlease open an issue if you find a bug or have a feature request.\n\n---\n\n# Author\n\nAlejandro Castrillon\n\n```\nGitHub: https://github.com/\n```\n","readmeFilename":"README.md"}