{"id":20129349,"url":"https://github.com/ryanmorr/ready","last_synced_at":"2025-08-13T09:33:40.136Z","repository":{"id":28769911,"uuid":"32292304","full_name":"ryanmorr/ready","owner":"ryanmorr","description":"Detect element availability on the initial page load and those dynamically appended to the DOM","archived":false,"fork":false,"pushed_at":"2024-06-16T09:54:28.000Z","size":559,"stargazers_count":79,"open_issues_count":1,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-06T18:12:53.732Z","etag":null,"topics":["dom","javascript","observer","ready"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanmorr.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}},"created_at":"2015-03-16T00:38:57.000Z","updated_at":"2024-02-19T18:33:31.000Z","dependencies_parsed_at":"2024-01-29T23:24:17.541Z","dependency_job_id":"462a80d1-b883-421c-b039-e6b77051c180","html_url":"https://github.com/ryanmorr/ready","commit_stats":{"total_commits":57,"total_committers":2,"mean_commits":28.5,"dds":0.01754385964912286,"last_synced_commit":"900858705e8f990931ddc5ea552a0e4bb155f474"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Fready","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Fready/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Fready/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Fready/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanmorr","download_url":"https://codeload.github.com/ryanmorr/ready/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229754919,"owners_count":18119134,"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","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":["dom","javascript","observer","ready"],"created_at":"2024-11-13T20:33:44.179Z","updated_at":"2024-12-14T21:07:39.591Z","avatar_url":"https://github.com/ryanmorr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ready\n\n[![Version Badge][version-image]][project-url]\n[![License][license-image]][license-url]\n[![Build Status][build-image]][build-url]\n\n\u003e Detect element availability on the initial page load and those dynamically appended to the DOM\n\n## Install\n\nDownload the [CJS](https://github.com/ryanmorr/ready/raw/master/dist/cjs/ready.js), [ESM](https://github.com/ryanmorr/ready/raw/master/dist/esm/ready.js), [UMD](https://github.com/ryanmorr/ready/raw/master/dist/umd/ready.js) versions or install via NPM:\n\n``` sh\nnpm install @ryanmorr/ready\n```\n\n## Usage\n\nProvide a selector string for the element(s) you want to target as the first argument and a callback function as the second argument. It returns a function that stops observing for new elements only for that particular selector/callback combination:\n\n``` javascript\nconst stop = ready('.foo', (element) =\u003e {\n    stop(); // Stop observing for \".foo\" elements\n});\n```\n\nWhen any element matching the selector becomes available, the callback is invoked in the context of the element as well as passing it as the only parameter. If multiple elements are found, the callback is invoked in succession for each element in document order.\n\nAlternatively, provide just the callback function as the only argument to add a generic DOM ready event listener:\n\n``` javascript\nready((doc) =\u003e {\n    // The DOM is ready\n});\n```\n\n## License\n\nThis project is dedicated to the public domain as described by the [Unlicense](http://unlicense.org/).\n\n[project-url]: https://github.com/ryanmorr/ready\n[version-image]: https://img.shields.io/github/package-json/v/ryanmorr/ready?color=blue\u0026style=flat-square\n[build-url]: https://github.com/ryanmorr/ready/actions\n[build-image]: https://img.shields.io/github/actions/workflow/status/ryanmorr/ready/node.js.yml?style=flat-square\n[license-image]: https://img.shields.io/github/license/ryanmorr/ready?color=blue\u0026style=flat-square\n[license-url]: UNLICENSE","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanmorr%2Fready","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanmorr%2Fready","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanmorr%2Fready/lists"}