{"id":16755466,"url":"https://github.com/paulsmithkc/domloaded","last_synced_at":"2026-04-17T10:07:38.071Z","repository":{"id":57215018,"uuid":"321084682","full_name":"paulsmithkc/domloaded","owner":"paulsmithkc","description":"This micro-library will allow you to easily delay code execution until the DOM is loaded.","archived":false,"fork":false,"pushed_at":"2021-07-28T03:31:40.000Z","size":244,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-21T10:55:07.253Z","etag":null,"topics":["dom","front-end","jquery","micro-library","npm-module","npm-package"],"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/paulsmithkc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-13T14:31:32.000Z","updated_at":"2023-02-14T08:19:29.000Z","dependencies_parsed_at":"2022-08-24T21:01:18.791Z","dependency_job_id":null,"html_url":"https://github.com/paulsmithkc/domloaded","commit_stats":null,"previous_names":["paulsmithkc/domready"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/paulsmithkc/domloaded","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulsmithkc%2Fdomloaded","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulsmithkc%2Fdomloaded/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulsmithkc%2Fdomloaded/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulsmithkc%2Fdomloaded/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulsmithkc","download_url":"https://codeload.github.com/paulsmithkc/domloaded/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulsmithkc%2Fdomloaded/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31924404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T09:10:15.403Z","status":"ssl_error","status_checked_at":"2026-04-17T09:10:14.455Z","response_time":62,"last_error":"SSL_read: 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":["dom","front-end","jquery","micro-library","npm-module","npm-package"],"created_at":"2024-10-13T03:22:37.720Z","updated_at":"2026-04-17T10:07:38.052Z","avatar_url":"https://github.com/paulsmithkc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# domloaded\n\n**This micro-library will allow you to easily delay code execution until the DOM is loaded.**\n\n* Unlike the [DOMContentLoaded](https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMContentLoaded_event) event, this also works when included after the DOM was loaded.\n\n* This function is designed to work in the same was as jQuery's [.ready()](https://api.jquery.com/ready/) event. However, it has been broken off as micro-libary to enable usage without importing the entire jQuery library. This enables you to still use it in Vanilla JS and React.js contexts where needed.\n\n* Breaking this off into a micro-library allows you to execute code sooner and can be used to improve your [Google Lighthouse](https://developers.google.com/web/tools/lighthouse) scores.\n\n## Install\nInstall the package with npm:\n```bash\nnpm install domloaded\n```\n\nOr download the built script files from GitHub Releases.\n\n## Basic Usage\n```js\ndomloaded(() =\u003e { /* dom is loaded... */ });\n```\n\n## Include with Express\n\n1. First install the npm package.\n    ```bash\n    npm install domloaded\n    ```\n\n2. Then serve the built script files via a static route.\n    ```js\n    app.use('/js', express.static('node_modules/domloaded/dist'));\n    ```\n\n3. Then link the script in your HTML/view.\n    ```html\n    \u003cscript src=\"/js/domloaded.min.js\"\u003e\u003c/script\u003e\n    ```\n\n4. And finally use it in your front-end code.\n    ```js\n    domloaded(() =\u003e { /* dom is loaded... */ });\n    ```\n\n## Include with Webpack/React\n\n1. First install the npm package.\n    ```bash\n    npm install domloaded\n    ```\n\n2. And then use it where needed:\n    ```js\n    import domloaded from 'domloaded';\n\n    domloaded(() =\u003e { /* dom is loaded... */ });\n    ```\n\n\n## Related\n\n- [MDN: document.readyState property](https://developer.mozilla.org/en-US/docs/Web/API/Document/readyState)\n- [MDN: readystatechange event](https://developer.mozilla.org/en-US/docs/Web/API/Document/readystatechange_event)\n- [MDN: DOMContentLoaded event](https://developer.mozilla.org/en-US/docs/Web/API/Document/DOMContentLoaded_event)\n- [MDN: load event](https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event)\n- [jQuery.ready() Guide](https://learn.jquery.com/using-jquery-core/document-ready/)\n- [jQuery.ready() API](https://api.jquery.com/ready/)\n- [domready package](https://www.npmjs.com/package/domready)\n- [dom-loaded package](https://www.npmjs.com/package/dom-loaded)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulsmithkc%2Fdomloaded","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulsmithkc%2Fdomloaded","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulsmithkc%2Fdomloaded/lists"}