{"id":13339482,"url":"https://github.com/syntax-tree/unist-util-find-all-after","last_synced_at":"2025-12-12T04:05:00.976Z","repository":{"id":1353219,"uuid":"42403403","full_name":"syntax-tree/unist-util-find-all-after","owner":"syntax-tree","description":"utility to find nodes after another node","archived":false,"fork":false,"pushed_at":"2023-07-07T13:15:27.000Z","size":131,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-10-11T18:51:15.664Z","etag":null,"topics":["find","sibling","syntax-tree","unist","unist-util","util"],"latest_commit_sha":null,"homepage":"https://unifiedjs.com","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/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-09-13T16:27:55.000Z","updated_at":"2022-05-20T23:07:50.000Z","dependencies_parsed_at":"2023-07-05T17:15:29.816Z","dependency_job_id":"f5fda390-9d42-449a-a941-62007185108d","html_url":"https://github.com/syntax-tree/unist-util-find-all-after","commit_stats":{"total_commits":93,"total_committers":5,"mean_commits":18.6,"dds":"0.053763440860215006","last_synced_commit":"10bfa298186ac103bc4f5ea4affcc5d07f81a1fa"},"previous_names":["wooorm/unist-util-find-all-after"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Funist-util-find-all-after","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Funist-util-find-all-after/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Funist-util-find-all-after/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Funist-util-find-all-after/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syntax-tree","download_url":"https://codeload.github.com/syntax-tree/unist-util-find-all-after/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221232937,"owners_count":16781661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["find","sibling","syntax-tree","unist","unist-util","util"],"created_at":"2024-07-29T19:20:03.876Z","updated_at":"2025-12-12T04:05:00.645Z","avatar_url":"https://github.com/syntax-tree.png","language":"JavaScript","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified"],"categories":["JavaScript"],"sub_categories":[],"readme":"# unist-util-find-all-after\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n[![Size][size-badge]][size]\n\n[unist][] utility to find nodes after another node.\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    *   [`findAllAfter(parent, child|index[, test])`](#findallafterparent-childindex-test)\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 find nodes after another node or\nbefore an index in a parent.\n\n## When should I use this?\n\nThis is super tiny.\nYou can of course do it yourself.\nBut this helps when integrating with the rest of unified and unist.\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-find-all-after\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {findAllAfter} from 'https://esm.sh/unist-util-find-all-after@5'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import {findAllAfter} from 'https://esm.sh/unist-util-find-all-after@5?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\n```js\nimport {u} from 'unist-builder'\nimport {findAllAfter} from 'unist-util-find-all-after'\n\nconst tree = u('tree', [\n  u('leaf', 'leaf 1'),\n  u('parent', [u('leaf', 'leaf 2'), u('leaf', 'leaf 3')]),\n  u('leaf', 'leaf 4'),\n  u('parent', [u('leaf', 'leaf 5')]),\n  u('leaf', 'leaf 6'),\n  u('empty'),\n  u('leaf', 'leaf 7')\n])\n\nconsole.log(findAllAfter(tree, 1, 'leaf'))\n```\n\nYields:\n\n```js\n[\n  {type: 'leaf', value: 'leaf 4'},\n  {type: 'leaf', value: 'leaf 6'},\n  {type: 'leaf', value: 'leaf 7'}\n]\n```\n\n## API\n\nThis package exports the identifier [`findAllAfter`][api-find-all-after].\nThere is no default export.\n\n### `findAllAfter(parent, child|index[, test])`\n\nFind the nodes in `parent` before a `child` or before an index, that pass\n`test`.\n\n###### Parameters\n\n*   `parent` ([`Node`][node])\n    — parent node\n*   `index` (`number`)\n    — index of child in `parent`\n*   `child` ([`Node`][node])\n    — child in `parent`\n*   `test` ([`Test`][test])\n    — `unist-util-is`-compatible test\n\n###### Returns\n\nChildren of `parent` ([`Array\u003cNode\u003e`][node]).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types (types for the test are in `unist-util-is`).\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-find-all-after@^5`, 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-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-after`](https://github.com/syntax-tree/unist-util-find-all-after)\n    — find all nodes after another node\n*   [`unist-util-find-all-before`](https://github.com/syntax-tree/unist-util-find-all-before)\n    — find all nodes 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, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n\u003c!-- Definitions --\u003e\n\n[build-badge]: https://github.com/syntax-tree/unist-util-find-all-after/workflows/main/badge.svg\n\n[build]: https://github.com/syntax-tree/unist-util-find-all-after/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-find-all-after.svg\n\n[coverage]: https://codecov.io/github/syntax-tree/unist-util-find-all-after\n\n[downloads-badge]: https://img.shields.io/npm/dm/unist-util-find-all-after.svg\n\n[downloads]: https://www.npmjs.com/package/unist-util-find-all-after\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-find-all-after\n\n[size]: https://bundlejs.com/?q=unist-util-find-all-after\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#node\n\n[test]: https://github.com/syntax-tree/unist-util-is#test\n\n[api-find-all-after]: #findallafterparent-childindex-test\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntax-tree%2Funist-util-find-all-after","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyntax-tree%2Funist-util-find-all-after","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntax-tree%2Funist-util-find-all-after/lists"}