{"id":19090734,"url":"https://github.com/kodedninja/lazytrigger","last_synced_at":"2026-06-17T12:32:32.289Z","repository":{"id":57677355,"uuid":"176338890","full_name":"kodedninja/lazytrigger","owner":"kodedninja","description":"Notify when certain points of the DOM enter / leave the view","archived":false,"fork":false,"pushed_at":"2019-03-20T18:41:40.000Z","size":4,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-12T12:32:02.653Z","etag":null,"topics":[],"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/kodedninja.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}},"created_at":"2019-03-18T17:42:01.000Z","updated_at":"2024-01-12T19:47:51.000Z","dependencies_parsed_at":"2022-09-10T18:21:39.701Z","dependency_job_id":null,"html_url":"https://github.com/kodedninja/lazytrigger","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kodedninja/lazytrigger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedninja%2Flazytrigger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedninja%2Flazytrigger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedninja%2Flazytrigger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedninja%2Flazytrigger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kodedninja","download_url":"https://codeload.github.com/kodedninja/lazytrigger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedninja%2Flazytrigger/sbom","scorecard":{"id":565559,"data":{"date":"2025-08-11","repo":{"name":"github.com/kodedninja/lazytrigger","commit":"4c35b998be2a89b3b19255c484ee542c5cd7ee46"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/6 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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":"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":"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":"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":"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"}}]},"last_synced_at":"2025-08-20T14:53:41.919Z","repository_id":57677355,"created_at":"2025-08-20T14:53:41.919Z","updated_at":"2025-08-20T14:53:41.919Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34449277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"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":[],"created_at":"2024-11-09T03:08:51.596Z","updated_at":"2026-06-17T12:32:32.268Z","avatar_url":"https://github.com/kodedninja.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lazytrigger\n\u003ca href=\"https://www.npmjs.com/package/lazytrigger\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/v/lazytrigger.svg?style=flat-square\" alt=\"NPM version\" /\u003e\n\u003c/a\u003e\n\nNotify when certain points of the DOM enter / leave the view using [on-intersect](https://github.com/yoshuawuyts/on-intersect).\n\n## Installation\n```\nnpm i --save lazytrigger\n```\n\n## Example\n\n```javascript\nvar html = require('nanohtml')\nvar LazyTrigger = require('lazytrigger')\n\nvar trigger = new LazyTrigger(onEnter, onLeave)\n\nmodule.exports = () =\u003e {\n  return html`\n    \u003cdiv style=\"font-size: 5rem;\"\u003e\n      \u003cdiv style=\"height: 200vh\"\u003eScroll down, check the console...\u003c/div\u003e\n      ${trigger.breakpoint('first')}\n      \u003cdiv style=\"height: 200vh\"\u003eEven more...\u003c/div\u003e\n      ${trigger.breakpoint('second')}\n    \u003c/div\u003e\n  `\n}\n\nfunction onEnter (id) {\n  console.log(id + ' entered')\n}\n\nfunction onLeave (id) {\n  console.log(id + ' left')\n}\n```\n\n## Why?\nPut it to the bottom of an endless scrolling list, play sounds, change the background image, autoplay videos, you name it.\n\n## API\n\n### `trigger = new LazyTrigger(onEnter(id), onLeave(id))`\nInitialize a new handler. `onEnter` is called when a breakpoint enters the view, `onLeave` is called when a breakpoint leaves the view; both get the `id` of the breakpoint.\n\n### `trigger.breakpoint(id)`\nReturns an empty element that will be observed. It has a comment inside (`\u003c!-- lazytrigger {id} --\u003e`) in order to be easily identifiable.\n\n### `trigger.stop(id)`\nStop observing a specific breakpoint.\n\n### `trigger.stopAll()`\nStop observing all the breakpoints.\n\n## See Also\n- [yoshuawuyts/on-intersect](https://github.com/yoshuawuyts/on-intersect)\n- [jongacnik/monolazy](https://github.com/jongacnik/monolazy)\n- [kodedninja/bik](https://github.com/kodedninja/bik)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkodedninja%2Flazytrigger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkodedninja%2Flazytrigger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkodedninja%2Flazytrigger/lists"}