@@ -35,7 +35,7 @@ of something in a file.
35
35
## Install
36
36
37
37
This package is [ ESM only] [ esm ] .
38
- In Node.js (version 12.20+, 14.14+, 16.0+, 18 .0+), install with [ npm] [ ] :
38
+ In Node.js (version 14.14+ and 16 .0+), install with [ npm] [ ] :
39
39
40
40
``` sh
41
41
npm install unist-util-source
@@ -44,14 +44,14 @@ npm install unist-util-source
44
44
In Deno with [ ` esm.sh ` ] [ esmsh ] :
45
45
46
46
``` js
47
- import {source } from " https://esm.sh/unist-util-source@4"
47
+ import {source } from ' https://esm.sh/unist-util-source@4'
48
48
```
49
49
50
50
In browsers with [ ` esm.sh ` ] [ esmsh ] :
51
51
52
52
``` html
53
53
<script type =" module" >
54
- import {source } from " https://esm.sh/unist-util-source@4?bundle"
54
+ import {source } from ' https://esm.sh/unist-util-source@4?bundle'
55
55
</script >
56
56
```
57
57
@@ -86,7 +86,7 @@ console.log(source(strong, file))
86
86
87
87
## API
88
88
89
- This package exports the identifier ` source ` .
89
+ This package exports the identifier [ ` source ` ] [ source ] .
90
90
There is no default export.
91
91
92
92
### ` source(value, file) `
@@ -95,12 +95,14 @@ Get the source of a node or at a position.
95
95
96
96
###### Parameters
97
97
98
- * ` value ` ([ ` Node ` ] [ node ] or [ ` Position ` ] [ position ] ) — value to get
99
- * ` file ` ([ ` VFile ` ] [ vfile ] or ` string ` ) — file in which ` value ` exists
98
+ * ` value ` ([ ` Node ` ] [ node ] or [ ` Position ` ] [ position ] )
99
+ — value to get
100
+ * ` file ` ([ ` VFile ` ] [ vfile ] or ` string ` )
101
+ — file in which ` value ` exists
100
102
101
103
###### Returns
102
104
103
- Source of ` value ` in ` doc ` , if available (` string? ` ).
105
+ Source of ` value ` in ` doc ` , if available (` string ` or ` null ` ).
104
106
105
107
## Types
106
108
@@ -111,7 +113,7 @@ It exports no additional types.
111
113
112
114
Projects maintained by the unified collective are compatible with all maintained
113
115
versions of Node.js.
114
- As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18 .0+.
116
+ As of now, that is Node.js 14.14+ and 16 .0+.
115
117
Our projects sometimes work with older versions, but this is not guaranteed.
116
118
117
119
## Contribute
@@ -183,3 +185,5 @@ abide by its terms.
183
185
[ position ] : https://github.com/syntax-tree/unist#position
184
186
185
187
[ vfile ] : https://github.com/vfile/vfile
188
+
189
+ [ source ] : #sourcevalue-file
0 commit comments