1 # unist-util-find-all-after
3 [![Build][build-badge]][build]
4 [![Coverage][coverage-badge]][coverage]
5 [![Downloads][downloads-badge]][downloads]
6 [![Sponsors][sponsors-badge]][collective]
7 [![Backers][backers-badge]][collective]
8 [![Chat][chat-badge]][chat]
9 [![Size][size-badge]][size]
11 [**unist**][unist] utility to find nodes after another node.
18 npm install unist-util-find-all-after
24 var u = require('unist-builder')
25 var findAllAfter = require('unist-util-find-all-after')
27 var tree = u('tree', [
29 u('node', [u('leaf', 'leaf 2'), u('leaf', 'leaf 3')]),
31 u('node', [u('leaf', 'leaf 5')]),
37 console.log(findAllAfter(tree, 1, 'leaf'))
44 { type: 'leaf', value: 'leaf 4' },
45 { type: 'leaf', value: 'leaf 6' },
46 { type: 'leaf', value: 'leaf 7' }
52 ### `findAllAfter(parent, node|index[, test])`
54 Find all children after `index` (or `node`) in `parent`, that passes `test`
59 * `parent` ([`Node`][node]) — [Parent][] node
60 * `node` ([`Node`][node]) — [Child][] of `parent`
61 * `index` (`number`, optional) — [Index][] in `parent`
62 * `test` (`Function`, `string`, `Object`, `Array`, optional)
63 — See [`unist-util-is`][is]
67 [`Array.<Node>`][node] — [Child][]ren of `parent` passing `test`.
71 * [`unist-util-find-after`](https://github.com/syntax-tree/unist-util-find-after)
72 — Find a node after another node
73 * [`unist-util-find-before`](https://github.com/syntax-tree/unist-util-find-before)
74 — Find a node before another node
75 * [`unist-util-find-all-before`](https://github.com/syntax-tree/unist-util-find-all-before)
76 — Find all nodes before another node
77 * [`unist-util-find-all-between`](https://github.com/mrzmmr/unist-util-find-all-between)
78 — Find all nodes between two nodes
79 * [`unist-util-find`](https://github.com/blahah/unist-util-find)
80 — Find nodes matching a predicate
84 See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
86 See [`support.md`][support] for ways to get help.
88 This project has a [Code of Conduct][coc].
89 By interacting with this repository, organisation, or community you agree to
94 [MIT][license] © [Titus Wormer][author]
98 [build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-find-all-after.svg
100 [build]: https://travis-ci.org/syntax-tree/unist-util-find-all-after
102 [coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-find-all-after.svg
104 [coverage]: https://codecov.io/github/syntax-tree/unist-util-find-all-after
106 [downloads-badge]: https://img.shields.io/npm/dm/unist-util-find-all-after.svg
108 [downloads]: https://www.npmjs.com/package/unist-util-find-all-after
110 [size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-find-all-after.svg
112 [size]: https://bundlephobia.com/result?p=unist-util-find-all-after
114 [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
116 [backers-badge]: https://opencollective.com/unified/backers/badge.svg
118 [collective]: https://opencollective.com/unified
120 [chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
122 [chat]: https://spectrum.chat/unified/syntax-tree
124 [npm]: https://docs.npmjs.com/cli/install
128 [author]: https://wooorm.com
130 [unist]: https://github.com/syntax-tree/unist
132 [node]: https://github.com/syntax-tree/unist#node
134 [parent]: https://github.com/syntax-tree/unist#parent-1
136 [child]: https://github.com/syntax-tree/unist#child
138 [index]: https://github.com/syntax-tree/unist#index
140 [is]: https://github.com/syntax-tree/unist-util-is
142 [contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md
144 [support]: https://github.com/syntax-tree/.github/blob/master/support.md
146 [coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md