{"id":21995741,"url":"https://github.com/excaliburhan/xp-dom","last_synced_at":"2026-04-20T03:33:54.100Z","repository":{"id":57402052,"uuid":"85558591","full_name":"excaliburhan/xp-dom","owner":"excaliburhan","description":"A pack to handle dom","archived":false,"fork":false,"pushed_at":"2018-01-26T02:30:14.000Z","size":51,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-21T21:29:11.306Z","etag":null,"topics":["dom","javascript","library"],"latest_commit_sha":null,"homepage":null,"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/excaliburhan.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":"2017-03-20T09:34:37.000Z","updated_at":"2017-03-22T09:55:26.000Z","dependencies_parsed_at":"2022-09-15T18:50:53.060Z","dependency_job_id":null,"html_url":"https://github.com/excaliburhan/xp-dom","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/excaliburhan/xp-dom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excaliburhan%2Fxp-dom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excaliburhan%2Fxp-dom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excaliburhan%2Fxp-dom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excaliburhan%2Fxp-dom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/excaliburhan","download_url":"https://codeload.github.com/excaliburhan/xp-dom/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excaliburhan%2Fxp-dom/sbom","scorecard":{"id":387635,"data":{"date":"2025-08-11","repo":{"name":"github.com/excaliburhan/xp-dom","commit":"6316c08df22862eb569e93e2111c16d8d184b6d7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/10 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":"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":"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":"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":"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":"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 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"}},{"name":"Vulnerabilities","score":0,"reason":"27 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-832h-xg76-4gv6","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T17:02:33.984Z","repository_id":57402052,"created_at":"2025-08-18T17:02:33.984Z","updated_at":"2025-08-18T17:02:33.984Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32031609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"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":["dom","javascript","library"],"created_at":"2024-11-29T21:18:20.468Z","updated_at":"2026-04-20T03:33:54.076Z","avatar_url":"https://github.com/excaliburhan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xp-dom\nA pack to handle dom\n\n## Installation\n\u003e npm i xp-dom --save\n\n## Usage\n```js\nimport { on, off } from 'xp-dom'\n// var on = require('xp-dom').on\n\nfunction say() { console.log(1) }\nlet div = document.querySelector('.box')\n\non(div, 'click', say)\n// on('.box', 'click', say)\noff(div, 'click', say)\n```\n\n## API\n\n### event\n\n#### on(elem, type, handler)\n- attach an event\n```js\non('.box', 'click', fn)\n```\n\n#### off(elem, type, handler)\n- remove an event\n```js\non('.box', 'click', fn)\n```\n\n#### one(elem, type, hander)\n- add an event just once\n```js\none('.box', 'click', fn)\n```\n\n#### delegate(selector, type, handler, parent)\n- delegate an event whenever the dom exsists or not, use event buble, so not all types event are supported.\n- selector cant be DOMElemnt.\n- parent default is `\u003cbody\u003e\u003c/body\u003e`\n```js\ndelegate('.box2', 'click', fn)\ndocument.querySelector('.box').classList.add('box2') // click box2 will trigger fn\n```\n\n#### undelegate(selector, type, handler, parent)\n- remove delegate\n```js\ndelegate('.box2', 'click', fn)\nundelegate('.box2', 'click', fn)\ndocument.querySelector('.box').classList.add('box2') // click box2 will not trigger fn\n```\n\n### element\n\n#### matches(elem, selector)\n- returns true if the element would be selected by the specified selector string; otherwise, returns false.\n```js\n// \u003cdiv class=\"box box1\"\u003e\u003c/div\u003e\nmatches(document.querySelector('.box'), '.box2') // false\n```\n\n#### closest(elem, selector)\n- returns the closest ancestor of the current element\n```js\n// \u003cdiv class=\"box\"\u003e\u003cp\u003e\u003c/p\u003e\u003c/div\u003e\nmatches(document.querySelector('p'), '.box') // return the DivElement\n```\n\n### classlist\n\n#### hasClass(elem, className)\n- returns ture if element has the className. same as classList.contains.\n```js\n// \u003cdiv class=\"box\"\u003e\u003c/div\u003e\nhasClass('div', 'box') // true\n```\n\n#### addClass(elem, className)\n- add className for element. same as classList.add.\n```js\n// \u003cdiv class=\"box\"\u003e\u003c/div\u003e\naddClass('div', 'box2') // \u003cdiv class=\"box box2\"\u003e\u003c/div\u003e\n```\n\n#### removeClass(elem, className)\n- remove className for element. same as classList.remove.\n```js\n// \u003cdiv class=\"box\"\u003e\u003c/div\u003e\nremoveClass('div', 'box') // \u003cdiv class\u003e\u003c/div\u003e\n```\n\n#### toggleClass(elem, className)\n- toggle className for element. same as classList.toggle.\n```js\n// \u003cdiv class=\"box\"\u003e\u003c/div\u003e\ntoggleClass('div', 'box2') // \u003cdiv class=\"box box2\"\u003e\u003c/div\u003e\ntoggleClass('div', 'box') // \u003cdiv class\u003e\u003c/div\u003e\n```\n\n#### itemClass(elem, number)\n- returns className by index in collection. same as classList.item.\n```js\n// \u003cdiv class=\"box\"\u003e\u003c/div\u003e\nitemClass('div', 0) // box\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexcaliburhan%2Fxp-dom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexcaliburhan%2Fxp-dom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexcaliburhan%2Fxp-dom/lists"}