.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / unist-util-find-all-after / readme.md
1 # unist-util-find-all-after
2
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]
10
11 [**unist**][unist] utility to find nodes after another node.
12
13 ## Installation
14
15 [npm][]:
16
17 ```bash
18 npm install unist-util-find-all-after
19 ```
20
21 ## Usage
22
23 ```js
24 var u = require('unist-builder')
25 var findAllAfter = require('unist-util-find-all-after')
26
27 var tree = u('tree', [
28   u('leaf', 'leaf 1'),
29   u('node', [u('leaf', 'leaf 2'), u('leaf', 'leaf 3')]),
30   u('leaf', 'leaf 4'),
31   u('node', [u('leaf', 'leaf 5')]),
32   u('leaf', 'leaf 6'),
33   u('void'),
34   u('leaf', 'leaf 7')
35 ])
36
37 console.log(findAllAfter(tree, 1, 'leaf'))
38 ```
39
40 Yields:
41
42 ```js
43 [
44   { type: 'leaf', value: 'leaf 4' },
45   { type: 'leaf', value: 'leaf 6' },
46   { type: 'leaf', value: 'leaf 7' }
47 ]
48 ```
49
50 ## API
51
52 ### `findAllAfter(parent, node|index[, test])`
53
54 Find all children after `index` (or `node`) in `parent`, that passes `test`
55 (when given).
56
57 ###### Parameters
58
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]
64
65 ###### Returns
66
67 [`Array.<Node>`][node] — [Child][]ren of `parent` passing `test`.
68
69 ## Related
70
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
81
82 ## Contribute
83
84 See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
85 started.
86 See [`support.md`][support] for ways to get help.
87
88 This project has a [Code of Conduct][coc].
89 By interacting with this repository, organisation, or community you agree to
90 abide by its terms.
91
92 ## License
93
94 [MIT][license] © [Titus Wormer][author]
95
96 <!-- Definitions -->
97
98 [build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-find-all-after.svg
99
100 [build]: https://travis-ci.org/syntax-tree/unist-util-find-all-after
101
102 [coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-find-all-after.svg
103
104 [coverage]: https://codecov.io/github/syntax-tree/unist-util-find-all-after
105
106 [downloads-badge]: https://img.shields.io/npm/dm/unist-util-find-all-after.svg
107
108 [downloads]: https://www.npmjs.com/package/unist-util-find-all-after
109
110 [size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-find-all-after.svg
111
112 [size]: https://bundlephobia.com/result?p=unist-util-find-all-after
113
114 [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
115
116 [backers-badge]: https://opencollective.com/unified/backers/badge.svg
117
118 [collective]: https://opencollective.com/unified
119
120 [chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
121
122 [chat]: https://spectrum.chat/unified/syntax-tree
123
124 [npm]: https://docs.npmjs.com/cli/install
125
126 [license]: license
127
128 [author]: https://wooorm.com
129
130 [unist]: https://github.com/syntax-tree/unist
131
132 [node]: https://github.com/syntax-tree/unist#node
133
134 [parent]: https://github.com/syntax-tree/unist#parent-1
135
136 [child]: https://github.com/syntax-tree/unist#child
137
138 [index]: https://github.com/syntax-tree/unist#index
139
140 [is]: https://github.com/syntax-tree/unist-util-is
141
142 [contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md
143
144 [support]: https://github.com/syntax-tree/.github/blob/master/support.md
145
146 [coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md