{"id":27920308,"url":"https://github.com/omtanke/react-use-event-outside","last_synced_at":"2025-10-25T01:35:06.672Z","repository":{"id":51304794,"uuid":"367362855","full_name":"omtanke/react-use-event-outside","owner":"omtanke","description":"It allows you to perform your operations in locations other than the place marked with ref.","archived":false,"fork":false,"pushed_at":"2021-05-22T14:19:20.000Z","size":35,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-23T21:20:59.639Z","etag":null,"topics":["react","reacthooks","ref"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/omtanke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2021-05-14T12:56:48.000Z","updated_at":"2021-08-25T06:40:23.000Z","dependencies_parsed_at":"2022-08-25T10:31:05.011Z","dependency_job_id":null,"html_url":"https://github.com/omtanke/react-use-event-outside","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/omtanke/react-use-event-outside","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omtanke%2Freact-use-event-outside","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omtanke%2Freact-use-event-outside/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omtanke%2Freact-use-event-outside/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omtanke%2Freact-use-event-outside/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omtanke","download_url":"https://codeload.github.com/omtanke/react-use-event-outside/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omtanke%2Freact-use-event-outside/sbom","scorecard":{"id":706553,"data":{"date":"2025-08-11","repo":{"name":"github.com/omtanke/react-use-event-outside","commit":"d2de091eed836d13671281428980fc3cb313af32"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/release-package.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":"Code-Review","score":0,"reason":"Found 0/28 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":"Security-Policy","score":4,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Warn: no linked content found","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":"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":"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":"Pinned-Dependencies","score":2,"reason":"dependency not pinned by hash detected -- score normalized to 2","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/omtanke/react-use-event-outside/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/omtanke/react-use-event-outside/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/omtanke/react-use-event-outside/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/omtanke/react-use-event-outside/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-package.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/omtanke/react-use-event-outside/release-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-package.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/omtanke/react-use-event-outside/release-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-package.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/omtanke/react-use-event-outside/release-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-package.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/omtanke/react-use-event-outside/release-package.yml/main?enable=pin","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand 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":"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":"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":"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":"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":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 4 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-22T06:45:08.860Z","repository_id":51304794,"created_at":"2025-08-22T06:45:08.860Z","updated_at":"2025-08-22T06:45:08.860Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280893650,"owners_count":26409279,"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-24T02:00:06.418Z","response_time":73,"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":["react","reacthooks","ref"],"created_at":"2025-05-06T20:58:21.900Z","updated_at":"2025-10-25T01:35:06.638Z","avatar_url":"https://github.com/omtanke.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-use-event-outside\n\n## Installation\n\nInstall with [Yarn](https://yarnpkg.com/):\n\n```sh\nyarn add @omtanke/react-use-event-outside\n```\n\nOr with [NPM](https://www.npmjs.com/):\n\n```sh\nnpm i @omtanke/react-use-event-outside\n```\n\nImport into your component like so:\n\n```javascript\nimport useEventOutside from '@omtanke/react-use-event-outside';\n```\n\n## Usage\n\n```javascript\nuseEventOutside(REF, EVENT_NAME, FUNCTION);\n```\n**REF**: Outside which element you want to trigger.\n\n**EVENT_NAME**: You want to listen to the event (Ex: 'mousedown', 'touchstart', etc.).\n\n**FUNCTION**: The function you want to run when triggered.\n\n### Example\n\n[CodeSandbox](https://codesandbox.io/s/useeventoutside-6gfby?file=/src/App.js)\n\nor\n\n```javascript\nconst App = () =\u003e {\n    const ref = useRef(null);\n    const [isOpen, setIsOpen] = useState(false);\n    \n    const closeMenu = useCallback(() =\u003e {\n        setIsOpen(false);\n    }, []);\n    \n    useEventOutside(ref, 'mousedown', closeMenu);\n    \n    return (\n        \u003cnav className=\"dropdown\" ref={ref}\u003e\n            \u003cbutton onClick={() =\u003e setIsOpen(!isOpen)}\u003eToggle\u003c/button\u003e\n            {isOpen \u0026\u0026\n                \u003cul className='dropdown-menu'\u003e\n                    \u003cli className='dropdown-item'\u003eItem\u003c/li\u003e\n                    \u003cli className='dropdown-item'\u003eItem\u003c/li\u003e\n                \u003c/ul\u003e    \n            }\n        \u003c/nav\u003e\n    );\n};\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomtanke%2Freact-use-event-outside","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomtanke%2Freact-use-event-outside","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomtanke%2Freact-use-event-outside/lists"}