17
17
* [ Install] ( #install )
18
18
* [ Use] ( #use )
19
19
* [ API] ( #api )
20
- * [ ` position(node? ) ` ] ( #positionnode )
21
- * [ ` pointStart (node? )` ] ( #pointstartnode )
22
- * [ ` pointEnd (node? )` ] ( #pointendnode )
20
+ * [ ` position(node) ` ] ( #positionnode )
21
+ * [ ` pointEnd (node)` ] ( #pointendnode )
22
+ * [ ` pointStart (node)` ] ( #pointstartnode )
23
23
* [ Types] ( #types )
24
24
* [ Compatibility] ( #compatibility )
25
25
* [ Related] ( #related )
@@ -48,7 +48,7 @@ to display positional info to users.
48
48
## Install
49
49
50
50
This package is [ ESM only] [ esm ] .
51
- In Node.js (version 12.20+, 14.14+, 16.0+, 18 .0+), install with [ npm] [ ] :
51
+ In Node.js (version 14.14+ and 16 .0+), install with [ npm] [ ] :
52
52
53
53
``` sh
54
54
npm install unist-util-position
@@ -57,14 +57,14 @@ npm install unist-util-position
57
57
In Deno with [ ` esm.sh ` ] [ esmsh ] :
58
58
59
59
``` js
60
- import {position , pointStart , pointEnd } from " https://esm.sh/unist-util-position@4"
60
+ import {position , pointStart , pointEnd } from ' https://esm.sh/unist-util-position@4'
61
61
```
62
62
63
63
In browsers with [ ` esm.sh ` ] [ esmsh ] :
64
64
65
65
``` html
66
66
<script type =" module" >
67
- import {position , pointStart , pointEnd } from " https://esm.sh/unist-util-position@4?bundle"
67
+ import {position , pointStart , pointEnd } from ' https://esm.sh/unist-util-position@4?bundle'
68
68
</script >
69
69
```
70
70
@@ -90,21 +90,48 @@ Yields:
90
90
91
91
## API
92
92
93
- This package exports the identifiers ` position ` , ` pointStart ` , and
94
- ` pointEnd ` .
93
+ This package exports the identifiers [ ` pointEnd ` ] [ pointend ] ,
94
+ [ ` pointStart ` ] [ pointstart ] , and [ ` position ` ] [ position ] .
95
95
There is no default export.
96
96
97
- ### ` position(node? ) `
97
+ ### ` position(node) `
98
98
99
- Get the positional info of ` node ` ([ ` Node? ` ] [ node ] ).
100
- Returns a proper [ ` Position ` ] [ position ] .
99
+ Get the positional info of ` node ` .
101
100
102
- ### ` pointStart(node?) `
101
+ ###### Parameters
103
102
104
- ### ` pointEnd(node?) `
103
+ * ` node ` ([ ` Node ` ] [ node ] )
104
+ — node
105
105
106
- Get the start or end points in the positional info of ` node ` ([ ` Node? ` ] [ node ] ).
107
- Returns a proper [ ` Point ` ] [ point ] .
106
+ ###### Returns
107
+
108
+ Position ([ ` Position ` ] [ unist-position ] ).
109
+
110
+ ### ` pointEnd(node) `
111
+
112
+ Get the ending point of ` node ` .
113
+
114
+ ###### Parameters
115
+
116
+ * ` node ` ([ ` Node ` ] [ node ] )
117
+ — node
118
+
119
+ ###### Returns
120
+
121
+ Point ([ ` point ` ] [ unist-point ] ).
122
+
123
+ ### ` pointStart(node) `
124
+
125
+ Get the starting point of ` node ` .
126
+
127
+ ###### Parameters
128
+
129
+ * ` node ` ([ ` Node ` ] [ node ] )
130
+ — node
131
+
132
+ ###### Returns
133
+
134
+ Point ([ ` point ` ] [ unist-point ] ).
108
135
109
136
## Types
110
137
@@ -115,7 +142,7 @@ It exports no additional types.
115
142
116
143
Projects maintained by the unified collective are compatible with all maintained
117
144
versions of Node.js.
118
- As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18 .0+.
145
+ As of now, that is Node.js 14.14+ and 16 .0+.
119
146
Our projects sometimes work with older versions, but this is not guaranteed.
120
147
121
148
## Related
@@ -197,10 +224,16 @@ abide by its terms.
197
224
198
225
[ node ] : https://github.com/syntax-tree/unist#node
199
226
200
- [ position ] : https://github.com/syntax-tree/unist#position
227
+ [ unist- position] : https://github.com/syntax-tree/unist#position
201
228
202
- [ point ] : https://github.com/syntax-tree/unist#point
229
+ [ unist- point] : https://github.com/syntax-tree/unist#point
203
230
204
231
[ unist-util-generated ] : https://github.com/syntax-tree/unist-util-generated
205
232
206
233
[ unist-util-stringify-position ] : https://github.com/syntax-tree/unist-util-stringify-position
234
+
235
+ [ position ] : #positionnode
236
+
237
+ [ pointend ] : #pointendnode
238
+
239
+ [ pointstart ] : #pointstartnode
0 commit comments