{"id":15638130,"url":"https://github.com/andarist/babel-plugin-annotate-pure-calls","last_synced_at":"2025-10-06T02:23:04.299Z","repository":{"id":60774992,"uuid":"104444001","full_name":"Andarist/babel-plugin-annotate-pure-calls","owner":"Andarist","description":"This plugins helps with annotating top level functions calls with #__PURE__ comment.","archived":false,"fork":false,"pushed_at":"2025-01-07T09:38:38.000Z","size":116,"stargazers_count":92,"open_issues_count":5,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-02T13:51:58.167Z","etag":null,"topics":["babel","minify","plugin","pure","side-effects","uglifyjs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Andarist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-09-22T07:16:22.000Z","updated_at":"2025-05-28T16:59:53.000Z","dependencies_parsed_at":"2024-10-20T01:35:42.246Z","dependency_job_id":"c35ee95f-4be4-462c-aa2c-1d92eeb0a5d1","html_url":"https://github.com/Andarist/babel-plugin-annotate-pure-calls","commit_stats":{"total_commits":45,"total_committers":1,"mean_commits":45.0,"dds":0.0,"last_synced_commit":"2f847b6d851ae185e133845892afb71a4af613a6"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/Andarist/babel-plugin-annotate-pure-calls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andarist%2Fbabel-plugin-annotate-pure-calls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andarist%2Fbabel-plugin-annotate-pure-calls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andarist%2Fbabel-plugin-annotate-pure-calls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andarist%2Fbabel-plugin-annotate-pure-calls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Andarist","download_url":"https://codeload.github.com/Andarist/babel-plugin-annotate-pure-calls/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andarist%2Fbabel-plugin-annotate-pure-calls/sbom","scorecard":{"id":13110,"data":{"date":"2025-08-11","repo":{"name":"github.com/Andarist/babel-plugin-annotate-pure-calls","commit":"c238bb57f02617d7e49cae861a78068814eee6da"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/26 approved changesets -- score normalized to 0","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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"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":"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/Andarist/babel-plugin-annotate-pure-calls/ci.yml/main?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned"],"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":"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":"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":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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 'main'"],"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 9 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-14T15:03:41.354Z","repository_id":60774992,"created_at":"2025-08-14T15:03:41.355Z","updated_at":"2025-08-14T15:03:41.355Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278548018,"owners_count":26004818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["babel","minify","plugin","pure","side-effects","uglifyjs"],"created_at":"2024-10-03T11:19:06.133Z","updated_at":"2025-10-06T02:23:04.262Z","avatar_url":"https://github.com/Andarist.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel-plugin-annotate-pure-calls\n\n[![npm version](https://img.shields.io/npm/v/babel-plugin-annotate-pure-calls.svg)](https://www.npmjs.com/package/babel-plugin-annotate-pure-calls)\n[![Build Status](https://travis-ci.org/Andarist/babel-plugin-annotate-pure-calls.svg?branch=master)](https://travis-ci.org/Andarist/babel-plugin-annotate-pure-calls)\n[![npm](https://img.shields.io/npm/dm/babel-plugin-annotate-pure-calls.svg)](https://www.npmjs.com/package/babel-plugin-annotate-pure-calls)\n\nThis plugins helps with automatic **#\\_\\_PURE\\_\\_** annotation insertion. It add the comment to\n[top level call](#top-level-calls) expressions and new expressions in assignment contexts (those are considered by the\nplugin as **side effect free**). This helps [UglifyJS](https://github.com/mishoo/UglifyJS2) to perform dead code\nelimination more efficiently and therefore reduces the bundle sizes for the consumers.\n\n**NOTE:** It might break your code, so the caution is advised. Target audience for the plugin are libraries, which in\nvast major of use cases do not introduce side effects in top level calls. That doesn't mean that application bundles\ncannot benefit from the plugin.\n\n## Pure calls\n\n```js\n// pure call\nvar inc = add(1)\n\n// clearly impure - no assignment context\nmutate({ prop: 'value' })\n```\n\n## Top level calls\n\nTop level call (in terms of this plugin) is one that gets executed during script initialization. So it is every call\nlocated at the root of a file, but also a call in an IIFE that gets executed at startup (including nested ones).\n\n```js\nvar a = topLevelCall()\n\nb = function() {\n  noTopLevelCall()\n}\n\ntopLevelIIFEs = (function() {\n  var c = (function() {\n    var d = (function() {\n      var e = topLevelCall()\n    })()\n  })()\n})()\n```\n\n## Installation\n\n```sh\nnpm install --save-dev babel-plugin-annotate-pure-calls\n```\n\n## Usage\n\n### Via `.babelrc` (Recommended)\n\n**.babelrc**\n\n```json\n{\n  \"plugins\": [\"annotate-pure-calls\"]\n}\n```\n\n### Via CLI\n\n```sh\nbabel --plugins annotate-pure-calls script.js\n```\n\n### Via Node API\n\n```javascript\nrequire('babel-core').transform('var inc = add(1)', {\n  plugins: ['annotate-pure-calls'],\n})\n```\n\n### Usage with babel@6\n\nThe plugin works with babel@6, you might see unmet peer dependency warning though. If you want to get rid of it, please\ninstall `@babel/core@6.0.0-bridge.1`.\n\n## Similar projects\n\n- [annotate-pure-call-in-variable-declarator](https://github.com/morlay/babel-plugin-annotate-pure-call-in-variable-declarator)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandarist%2Fbabel-plugin-annotate-pure-calls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandarist%2Fbabel-plugin-annotate-pure-calls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandarist%2Fbabel-plugin-annotate-pure-calls/lists"}