{"id":13339440,"url":"https://github.com/syntax-tree/unist-util-visit-children","last_synced_at":"2026-04-06T06:04:51.824Z","repository":{"id":36942009,"uuid":"41249452","full_name":"syntax-tree/unist-util-visit-children","owner":"syntax-tree","description":"unist utility to visit direct children of a parent","archived":false,"fork":false,"pushed_at":"2023-07-07T10:48:10.000Z","size":110,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":8,"default_branch":"main","last_synced_at":"2026-04-01T06:53:08.202Z","etag":null,"topics":["syntax-tree","unist","unist-util","util","visit"],"latest_commit_sha":null,"homepage":"https://unifiedjs.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"perwendel/spark","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/syntax-tree.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,"governance":null},"funding":{"github":"unifiedjs","open_collective":"unified"}},"created_at":"2015-08-23T12:50:59.000Z","updated_at":"2026-01-12T06:30:57.000Z","dependencies_parsed_at":"2023-07-13T16:31:09.059Z","dependency_job_id":null,"html_url":"https://github.com/syntax-tree/unist-util-visit-children","commit_stats":{"total_commits":79,"total_committers":3,"mean_commits":"26.333333333333332","dds":0.03797468354430378,"last_synced_commit":"d957b0494d0656157238dd3a2901bf9b67c778fd"},"previous_names":["wooorm/unist-util-visit-children"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/syntax-tree/unist-util-visit-children","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Funist-util-visit-children","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Funist-util-visit-children/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Funist-util-visit-children/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Funist-util-visit-children/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syntax-tree","download_url":"https://codeload.github.com/syntax-tree/unist-util-visit-children/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Funist-util-visit-children/sbom","scorecard":{"id":863535,"data":{"date":"2025-08-11","repo":{"name":"github.com/syntax-tree/unist-util-visit-children","commit":"bb9d2ac6b7835e13668839eacbf8d60b86e59651"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 1/30 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":"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":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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/bb.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/syntax-tree/unist-util-visit-children/bb.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/syntax-tree/unist-util-visit-children/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/syntax-tree/unist-util-visit-children/main.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/syntax-tree/unist-util-visit-children/main.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:15","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   1 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/bb.yml:1","Warn: no topLevel permission defined: .github/workflows/main.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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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:0","Info: FSF or OSI recognized license: MIT License: license: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":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 1.1.4 not signed: https://api.github.com/repos/syntax-tree/unist-util-visit-children/releases/23524176","Warn: release artifact 1.1.4 does not have provenance: https://api.github.com/repos/syntax-tree/unist-util-visit-children/releases/23524176"],"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":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/syntax-tree/.github/security.md:1","Info: Found linked content: github.com/syntax-tree/.github/security.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/syntax-tree/.github/security.md:1","Info: Found text in security policy: github.com/syntax-tree/.github/security.md:1"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 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"}}]},"last_synced_at":"2025-08-24T02:01:46.344Z","repository_id":36942009,"created_at":"2025-08-24T02:01:46.344Z","updated_at":"2025-08-24T02:01:46.344Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31284565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"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":["syntax-tree","unist","unist-util","util","visit"],"created_at":"2024-07-29T19:20:03.248Z","updated_at":"2026-04-06T06:04:51.802Z","avatar_url":"https://github.com/syntax-tree.png","language":"JavaScript","readme":"# unist-util-visit-children\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n[unist][] utility to visit direct children of a parent.\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`visitChildren(visitor)`](#visitchildrenvisitor)\n    *   [`Visitor`](#visitor)\n    *   [`Visit`](#visit)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis is a tiny utility that you can use to create a reusable function that\nonly visits direct children.\n\n## When should I use this?\n\nProbably never!\nUse [`unist-util-visit`][unist-util-visit].\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install unist-util-visit-children\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {visitChildren} from 'https://esm.sh/unist-util-visit-children@3'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import {visitChildren} from 'https://esm.sh/unist-util-visit-children@3?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\n```js\nimport u from 'unist-builder'\nimport {visitChildren} from 'unist-util-visit-children'\n\nconst visit = visitChildren(function (node) {\n  console.log(node)\n})\n\nconst tree = u('tree', [\n  u('leaf', 'leaf 1'),\n  u('node', [u('leaf', 'leaf 2'), u('leaf', 'leaf 3')]),\n  u('leaf', 'leaf 4'),\n  u('void')\n])\n\nvisit(tree)\n```\n\nYields:\n\n```js\n{type: 'leaf', value: 'leaf 1'}\n{\n  type: 'node',\n  children: [\n    {type: 'leaf', value: 'leaf 2'},\n    {type: 'leaf', value: 'leaf 3'}\n  ]\n}\n{type: 'leaf', value: 'leaf 4'}\n{type: 'void'}\n```\n\n## API\n\nThis package exports the identifier [`visitChildren`][api-visitchildren].\nThere is no default export.\n\n### `visitChildren(visitor)`\n\nWrap `visitor` to be called for each child in the nodes later given to `visit`.\n\n###### Parameters\n\n*   `visitor` ([`Visitor`][api-visitor])\n    — callback called for each `child` in `parent` later given to `visit`\n\n###### Returns\n\nFunction to call the bound `visitor` for each child in `parent`\n([`Visit`][api-visit]).\n\n### `Visitor`\n\nCallback called for each `child` in `parent` later given to `visit`\n(TypeScript type).\n\n###### Parameters\n\n*   `child` ([`Node`][node])\n    — child of parent\n*   `index` (`number`)\n    — position of `child` in parent\n*   `parent` ([`Node`][node])\n    — parent node\n\n###### Returns\n\nNothing (`undefined`).\n\n### `Visit`\n\nFunction to call the bound `visitor` for each child in `parent`\n(TypeScript type).\n\n###### Parameters\n\n*   `parent` ([`Node`][node])\n    — parent node\n\n###### Returns\n\nNothing (`undefined`).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional types [`Visit`][api-visit] and\n[`Visitor`][api-visitor].\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line,\n`unist-util-visit-children@^3`, compatible with Node.js 16.\n\n## Related\n\n*   [`unist-util-visit`](https://github.com/syntax-tree/unist-util-visit)\n    — walk the tree\n*   [`unist-util-visit-parents`](https://github.com/syntax-tree/unist-util-visit-parents)\n    — walk the tree with a stack of parents\n*   [`unist-util-filter`](https://github.com/syntax-tree/unist-util-filter)\n    — create a new tree with all nodes that pass a test\n*   [`unist-util-map`](https://github.com/syntax-tree/unist-util-map)\n    — create a new tree with all nodes mapped by a given function\n*   [`unist-util-flatmap`](https://gitlab.com/staltz/unist-util-flatmap)\n    — create a new tree by mapping (to an array) with the given function\n*   [`unist-util-find-all-after`](https://github.com/syntax-tree/unist-util-find-all-after)\n    — find nodes after another node\n*   [`unist-util-find-all-before`](https://github.com/syntax-tree/unist-util-find-all-before)\n    — find nodes before another node\n*   [`unist-util-find-after`](https://github.com/syntax-tree/unist-util-find-after)\n    — find a node after another node\n*   [`unist-util-find-before`](https://github.com/syntax-tree/unist-util-find-before)\n    — find a node before another node\n*   [`unist-util-find-all-between`](https://github.com/mrzmmr/unist-util-find-all-between)\n    — find all nodes between two nodes\n*   [`unist-util-remove`](https://github.com/syntax-tree/unist-util-remove)\n    — remove nodes from a tree that pass a test\n*   [`unist-util-select`](https://github.com/syntax-tree/unist-util-select)\n    — select nodes with CSS-like selectors\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for\nways to get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organisation, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n\u003c!-- Definition --\u003e\n\n[build-badge]: https://github.com/syntax-tree/unist-util-visit-children/workflows/main/badge.svg\n\n[build]: https://github.com/syntax-tree/unist-util-visit-children/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-visit-children.svg\n\n[coverage]: https://codecov.io/github/syntax-tree/unist-util-visit-children\n\n[downloads-badge]: https://img.shields.io/npm/dm/unist-util-visit-children.svg\n\n[downloads]: https://www.npmjs.com/package/unist-util-visit-children\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size\u0026query=$.size.compressedSize\u0026url=https://deno.bundlejs.com/?q=unist-util-visit-children\n\n[size]: https://bundlejs.com/?q=unist-util-visit-children\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/syntax-tree/unist/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[typescript]: https://www.typescriptlang.org\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[health]: https://github.com/syntax-tree/.github\n\n[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md\n\n[support]: https://github.com/syntax-tree/.github/blob/main/support.md\n\n[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md\n\n[unist]: https://github.com/syntax-tree/unist\n\n[node]: https://github.com/syntax-tree/unist#nodes\n\n[unist-util-visit]: https://github.com/syntax-tree/unist-util-visit\n\n[api-visitchildren]: #visitchildrenvisitor\n\n[api-visit]: #visit\n\n[api-visitor]: #visitor\n","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntax-tree%2Funist-util-visit-children","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyntax-tree%2Funist-util-visit-children","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntax-tree%2Funist-util-visit-children/lists"}