{"id":18458774,"url":"https://github.com/browserify/static-eval","last_synced_at":"2026-01-15T22:21:06.903Z","repository":{"id":9628329,"uuid":"11557499","full_name":"browserify/static-eval","owner":"browserify","description":"evaluate statically-analyzable expressions","archived":false,"fork":false,"pushed_at":"2024-12-21T09:59:29.000Z","size":60,"stargazers_count":178,"open_issues_count":15,"forks_count":27,"subscribers_count":7,"default_branch":"master","last_synced_at":"2026-01-13T11:43:41.838Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"learn-co-curriculum/ruby-super-inheritance-","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/browserify.png","metadata":{"files":{"readme":"readme.markdown","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-07-21T05:12:47.000Z","updated_at":"2025-07-17T19:24:20.000Z","dependencies_parsed_at":"2024-01-16T10:37:42.869Z","dependency_job_id":"b4e568f1-507e-401f-a3c4-d39349338703","html_url":"https://github.com/browserify/static-eval","commit_stats":{"total_commits":76,"total_committers":16,"mean_commits":4.75,"dds":0.6842105263157895,"last_synced_commit":"c682147323a1dfde9e7c01a9558f4feeb68e36cd"},"previous_names":["substack/static-eval"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/browserify/static-eval","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fstatic-eval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fstatic-eval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fstatic-eval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fstatic-eval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/browserify","download_url":"https://codeload.github.com/browserify/static-eval/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fstatic-eval/sbom","scorecard":{"id":254788,"data":{"date":"2025-08-11","repo":{"name":"github.com/browserify/static-eval","commit":"c682147323a1dfde9e7c01a9558f4feeb68e36cd"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":2,"reason":"Found 4/17 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: security.md:1","Info: Found linked content: security.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: security.md:1","Info: Found text in security policy: security.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 18 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T09:22:59.053Z","repository_id":9628329,"created_at":"2025-08-17T09:22:59.053Z","updated_at":"2025-08-17T09:22:59.053Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28472626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T22:13:38.078Z","status":"ssl_error","status_checked_at":"2026-01-15T22:12:11.737Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T08:19:59.965Z","updated_at":"2026-01-15T22:21:06.882Z","avatar_url":"https://github.com/browserify.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"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/browserify/static-eval.png)](http://travis-ci.org/browserify/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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserify%2Fstatic-eval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrowserify%2Fstatic-eval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserify%2Fstatic-eval/lists"}