{"id":16375956,"url":"https://github.com/brettz9/handle-node","last_synced_at":"2026-01-31T22:07:26.102Z","repository":{"id":26628651,"uuid":"30084292","full_name":"brettz9/handle-node","owner":"brettz9","description":"Simple callback delegator based on DOM Node type","archived":false,"fork":false,"pushed_at":"2025-11-06T08:24:00.000Z","size":784,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-06T08:31:56.407Z","etag":null,"topics":["delegator","dom","dom-node","reducer"],"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/brettz9.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE-MIT.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-01-30T18:03:31.000Z","updated_at":"2025-11-06T08:23:20.000Z","dependencies_parsed_at":"2024-10-20T14:37:31.952Z","dependency_job_id":null,"html_url":"https://github.com/brettz9/handle-node","commit_stats":{"total_commits":56,"total_committers":2,"mean_commits":28.0,"dds":0.4285714285714286,"last_synced_commit":"8f1aee6eff7022c47be557cbeecb5cf7f45b613a"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/brettz9/handle-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettz9%2Fhandle-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettz9%2Fhandle-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettz9%2Fhandle-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettz9%2Fhandle-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brettz9","download_url":"https://codeload.github.com/brettz9/handle-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettz9%2Fhandle-node/sbom","scorecard":{"id":252665,"data":{"date":"2025-08-11","repo":{"name":"github.com/brettz9/handle-node","commit":"5fd5cad287f0ede9d3f6064ae0e01504a8e59982"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/4 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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"Maintained","score":1,"reason":"2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/coverage.yml:1","Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1","Warn: no topLevel permission defined: .github/workflows/npmpublish.yml:1","Info: no jobLevel write permissions found"],"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":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/coverage.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/brettz9/handle-node/coverage.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/brettz9/handle-node/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/brettz9/handle-node/nodejs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/brettz9/handle-node/npmpublish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/brettz9/handle-node/npmpublish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/brettz9/handle-node/npmpublish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/brettz9/handle-node/npmpublish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/brettz9/handle-node/npmpublish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/brettz9/handle-node/npmpublish.yml/main?enable=pin","Info:   0 out of   9 GitHub-owned GitHubAction dependencies pinned","Info:   5 out of   5 npmCommand dependencies pinned"],"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE-MIT.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE-MIT.txt:0"],"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 'main'"],"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 26 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":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7"],"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-17T08:53:58.868Z","repository_id":26628651,"created_at":"2025-08-17T08:53:58.868Z","updated_at":"2025-08-17T08:53:58.868Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28956992,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T18:30:42.805Z","status":"ssl_error","status_checked_at":"2026-01-31T18:30:19.593Z","response_time":128,"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":["delegator","dom","dom-node","reducer"],"created_at":"2024-10-11T03:22:47.233Z","updated_at":"2026-01-31T22:07:26.095Z","avatar_url":"https://github.com/brettz9.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm](http://img.shields.io/npm/v/handle-node.svg)](https://www.npmjs.com/package/handle-node)\n[![Dependencies](https://img.shields.io/david/brettz9/handle-node.svg)](https://david-dm.org/brettz9/handle-node)\n[![devDependencies](https://img.shields.io/david/dev/brettz9/handle-node.svg)](https://david-dm.org/brettz9/handle-node?type=dev)\n\n[![Actions Status](https://github.com/brettz9/handle-node/workflows/Node%20CI/badge.svg)](https://github.com/brettz9/handle-node/actions)\n[![Actions Status](https://github.com/brettz9/handle-node/workflows/Coverage/badge.svg)](https://github.com/brettz9/handle-node/actions)\n\n[![Known Vulnerabilities](https://snyk.io/test/github/brettz9/handle-node/badge.svg)](https://snyk.io/test/github/brettz9/handle-node)\n[![Total Alerts](https://img.shields.io/lgtm/alerts/g/brettz9/handle-node.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/brettz9/handle-node/alerts)\n[![Code Quality: Javascript](https://img.shields.io/lgtm/grade/javascript/g/brettz9/handle-node.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/brettz9/handle-node/context:javascript)\n\n[![License](https://img.shields.io/npm/l/handle-node.svg)](LICENSE-MIT.txt)\n\n# handle-node\n\nSimple callback delegator based on DOM Node type.\n\nProvides an alternative to switches, numeric constant-based delegation, and\nDOM `NodeIterator`s or `TreeWalker`s.\n\n## Installation\n\n```shell\nnpm install handle-node\n```\n\n### Native ESM\n\n```js\nimport handleNode from 'handle-node';\n```\n\n### CommonJS\n\n```js\nconst handleNode = require('handle-node');\n```\n\n### Browser (any)\n\n```html\n\u003cscript src=\"handle-node/dist/index-umd.js\"\u003e\u003c/script\u003e\n```\n\n### Browser (ESM - modern browsers only)\n\n```html\n\u003cscript type=\"module\"\u003e\nimport handleNode from './node_modules/handle-node/dist/index-esm.js';\n\n\u003c/script\u003e\n```\n\n## Usage\n\nSupply a node followed by a handler object whose all optional properties\n(human-readable Node type names) should be set to a callback which will\nbe passed the supplied Node and, always as the last argument, a reference\nto the object on which the callbacks exist. The return value will be\n`undefined` if a handler is missing, but otherwise will be the result of\ninvoking the callback which corresponds to the supplied node's type.\n\nHere is a demonstration reimplementing `textContent` (if only element\nand text types are known to be present):\n\n```js\nconst textContent = handleNode(node, { // This object is `textSerializer`\n  element ({childNodes}, textSerializer) {\n    return [...childNodes].reduce((str, node) =\u003e {\n      return str + handleNode(node, textSerializer);\n    }, '');\n  },\n  text: ({nodeValue}) =\u003e nodeValue\n});\n```\n\nOther arguments can also be passed in after the\nhandler object, and these will also be supplied to the callbacks:\n\n```js\nconst textContent = handleNode(\n  node,\n  { // This object is `textSerializer`\n    element ({childNodes}, arg1, arg2, textSerializer) {\n      return [...childNodes].reduce((str, node) =\u003e {\n        return str + handleNode(node, arg1, arg2, textSerializer);\n      }, '');\n    },\n    text: ({nodeValue}, arg1, arg2) =\u003e nodeValue\n  }, arg1, arg2\n);\n```\n\n## API\n\nThe handler object can take the following optional properties:\n\n- `element`\n- `attribute`\n- `text`\n- `cdata`\n- `entityReference`\n- `entity`\n- `processingInstruction`\n- `comment`\n- `document`\n- `documentType`\n- `documentFragment`\n- `notation`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrettz9%2Fhandle-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrettz9%2Fhandle-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrettz9%2Fhandle-node/lists"}