@@ -43,7 +43,7 @@ and similar to [`hastscript`][hastscript].
43
43
## Install
44
44
45
45
This package is [ ESM only] [ esm ] .
46
- In Node.js (version 14.14+ and 16.0 +), install with [ npm] [ ] :
46
+ In Node.js (version 16 +), install with [ npm] [ ] :
47
47
48
48
``` sh
49
49
npm install hast-util-from-selector
@@ -98,7 +98,7 @@ Yields:
98
98
99
99
## API
100
100
101
- This package exports the identifier [ ` fromSelector ` ] [ fromselector ] .
101
+ This package exports the identifier [ ` fromSelector ` ] [ api-from-selector ] .
102
102
There is no default export.
103
103
104
104
### ` fromSelector(selector?[, options]) `
@@ -107,9 +107,9 @@ Create one or more [`Element`][element]s from a CSS selector.
107
107
108
108
###### Parameters
109
109
110
- * ` selector ` (` string ` , optional )
110
+ * ` selector ` (` string ` , default: ` '' ` )
111
111
— CSS selector
112
- * ` options ` ([ ` Options ` ] [ options ] , optional)
112
+ * ` options ` ([ ` Options ` ] [ api- options] , optional)
113
113
— configuration
114
114
115
115
###### Returns
@@ -122,7 +122,7 @@ Configuration (TypeScript type).
122
122
123
123
###### Fields
124
124
125
- * ` space ` ([ ` Space ` ] [ space ] , optional )
125
+ * ` space ` ([ ` Space ` ] [ api- space] , default: ` 'html' ` )
126
126
— which space first element in the selector is in.
127
127
When an ` svg ` element is created in HTML, the space is automatically
128
128
switched to SVG
@@ -153,14 +153,18 @@ type Space = 'html' | 'svg'
153
153
## Types
154
154
155
155
This package is fully typed with [TypeScript][].
156
- It exports the additional types [ ` Options ` ][options] and [ ` Space ` ][space].
156
+ It exports the additional types [ ` Options ` ][api-options] and
157
+ [ ` Space ` ][api-space].
157
158
158
159
## Compatibility
159
160
160
- Projects maintained by the unified collective are compatible with all maintained
161
+ Projects maintained by the unified collective are compatible with maintained
161
162
versions of Node.js.
162
- As of now, that is Node.js 14.14+ and 16.0+.
163
- Our projects sometimes work with older versions, but this is not guaranteed.
163
+
164
+ When we cut a new major release, we drop support for unmaintained versions of
165
+ Node.
166
+ This means we try to keep the current release line,
167
+ ` hast -util -from -selector @^2 ` , compatible with Node.js 12.
164
168
165
169
## Security
166
170
@@ -204,9 +208,9 @@ abide by its terms.
204
208
205
209
[downloads]: https://www.npmjs.com/package/hast-util-from-selector
206
210
207
- [size-badge]: https://img.shields.io/bundlephobia/minzip/ hast-util-from-selector.svg
211
+ [size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q= hast-util-from-selector
208
212
209
- [size]: https://bundlephobia .com/result?p =hast-util-from-selector
213
+ [size]: https://bundlejs .com/?q =hast-util-from-selector
210
214
211
215
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
212
216
@@ -250,8 +254,8 @@ abide by its terms.
250
254
251
255
[hastscript]: https://github.com/syntax-tree/hastscript
252
256
253
- [fromselector ]: #fromselectorselector-options
257
+ [api-from-selector ]: #fromselectorselector-options
254
258
255
- [options]: #options
259
+ [api- options]: #options
256
260
257
- [space]: #space
261
+ [api- space]: #space
0 commit comments