{"id":42830378,"url":"https://github.com/wide/dom-observer","last_synced_at":"2026-01-30T11:26:57.746Z","repository":{"id":54500036,"uuid":"267885025","full_name":"wide/dom-observer","owner":"wide","description":"Fast and reliable DOM observer.","archived":false,"fork":false,"pushed_at":"2021-06-16T21:08:43.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-10-02T17:53:59.543Z","etag":null,"topics":["modulus"],"latest_commit_sha":null,"homepage":null,"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/wide.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":"2020-05-29T14:58:08.000Z","updated_at":"2021-06-16T21:08:03.000Z","dependencies_parsed_at":"2022-08-13T17:50:53.930Z","dependency_job_id":null,"html_url":"https://github.com/wide/dom-observer","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/wide/dom-observer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fdom-observer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fdom-observer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fdom-observer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fdom-observer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wide","download_url":"https://codeload.github.com/wide/dom-observer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fdom-observer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28911821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T08:15:08.179Z","status":"ssl_error","status_checked_at":"2026-01-30T08:14:31.507Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["modulus"],"created_at":"2026-01-30T11:26:57.247Z","updated_at":"2026-01-30T11:26:57.734Z","avatar_url":"https://github.com/wide.png","language":"JavaScript","readme":"# DOM Observer\r\n\r\nFast and reliable DOM observer.\r\n\r\n\r\n## Install\r\n\r\n```\r\nnpm install @wide/dom-observer --save\r\n```\r\n\r\n\r\n## Usage\r\n\r\n### Observe selector\r\n\r\n```\r\nobserve(selector, { bind[, unbind] })\r\n```\r\n- `selector` query selector to observe\r\n- `bind(el)` hook called when an element matching the selector appears in the DOM\r\n- `unbind(el)` hook called when this same element is removed from the DOM (optional)\r\n\r\nExemple:\r\n```js\r\nimport observe from '@wide/dom-observer'\r\n\r\nobserve('[data-foobar]', {\r\n  bind: el =\u003e console.log(`I'm in the DOM !`),\r\n  unbind: el =\u003e console.log(`I'm no longer in the DOM...`)\r\n})\r\n```\r\n\r\n### Unobserve selector\r\n\r\nDelete observer for a specific selector, all related elements will be unbinded\r\n\r\n```\r\nunobserve(selector)\r\n```\r\n\r\nExemple:\r\n```js\r\nimport { unobserve } from '@wide/dom-observer'\r\n\r\nunobserve('[data-foobar]')\r\n```\r\n\r\n## Unbind element\r\n\r\nUnbind all selectors for a specific element.\r\n\r\n```\r\nunbind(el)\r\n```\r\n\r\nExemple:\r\n```js\r\nimport { unbind } from '@wide/dom-observer'\r\n\r\nunbind(document.querySelector('#id'))\r\n```\r\n\r\n## Get selector's binded elements\r\n\r\nRetrieve the list of binded elements by selector.\r\n\r\n```\r\nseek(selector)\r\n```\r\n\r\nExemple:\r\n```js\r\nimport { seek } from '@wide/dom-observer'\r\n\r\nseek('[data-foobar]') // Array\u003cHTMLElement\u003e\r\n```\r\n\r\n\r\n## Authors\r\n\r\n- **Aymeric Assier** - [github.com/myeti](https://github.com/myeti)\r\n- **Julien Martins Da Costa** - [github.com/jdacosta](https://github.com/jdacosta)\r\n\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [licence](licence) file for details","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwide%2Fdom-observer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwide%2Fdom-observer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwide%2Fdom-observer/lists"}