8
8
[ ![ Backers] [ backers-badge ]] [ collective ]
9
9
[ ![ Chat] [ chat-badge ]] [ chat ]
10
10
11
- [ ** hast** ] [ hast ] utility to check whether a node is [ * interactive* ] [ spec ] .
11
+ [ hast] [ ] utility to check if a node is [ * interactive* ] [ spec ] .
12
12
13
- ## Install
13
+ ## Contents
14
+
15
+ * [ What is this?] ( #what-is-this )
16
+ * [ When should I use this?] ( #when-should-i-use-this )
17
+ * [ Install] ( #install )
18
+ * [ Use] ( #use )
19
+ * [ API] ( #api )
20
+ * [ ` interactive(node) ` ] ( #interactivenode )
21
+ * [ Types] ( #types )
22
+ * [ Compatibility] ( #compatibility )
23
+ * [ Security] ( #security )
24
+ * [ Related] ( #related )
25
+ * [ Contribute] ( #contribute )
26
+ * [ License] ( #license )
27
+
28
+ ## What is this?
29
+
30
+ This package is a small utility that checks if a node is interactive content
31
+ according to HTML.
32
+
33
+ ## When should I use this?
34
+
35
+ This utility is super niche, if you’re here you probably know what you’re
36
+ looking for!
14
37
15
- This package is [ ESM only] ( https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c ) :
16
- Node 12+ is needed to use it and it must be ` import ` ed instead of ` require ` d.
38
+ ## Install
17
39
18
- [ npm] [ ] :
40
+ This package is [ ESM only] [ esm ] .
41
+ In Node.js (version 12.20+, 14.14+, 16.0+, or 18.0+), install with [ npm] [ ] :
19
42
20
43
``` sh
21
44
npm install hast-util-interactive
22
45
```
23
46
47
+ In Deno with [ ` esm.sh ` ] [ esmsh ] :
48
+
49
+ ``` js
50
+ import {interactive } from ' https://esm.sh/hast-util-interactive@2'
51
+ ```
52
+
53
+ In browsers with [ ` esm.sh ` ] [ esmsh ] :
54
+
55
+ ``` html
56
+ <script type =" module" >
57
+ import {interactive } from ' https://esm.sh/hast-util-interactive@2?bundle'
58
+ </script >
59
+ ```
60
+
24
61
## Use
25
62
26
63
``` js
@@ -50,19 +87,33 @@ interactive({
50
87
51
88
## API
52
89
53
- This package exports the following identifiers: ` interactive ` .
90
+ This package exports the identifier ` interactive ` .
54
91
There is no default export.
55
92
56
93
### ` interactive(node) `
57
94
95
+ Check if the given value is [ * interactive* ] [ spec ] .
96
+
58
97
###### Parameters
59
98
60
- * ` node ` ([ ` Node ` ] [ node ] , optional) — Node to check.
99
+ * ` node ` ([ ` Node ` ] [ node ] , optional) — node to check
61
100
62
101
###### Returns
63
102
64
- ` boolean ` — Whether ` node ` is an [ ` Element ` ] [ element ] categorised as
65
- [ * interactive* ] [ spec ] .
103
+ Whether ` node ` is an [ ` Element ` ] [ element ] categorised as [ * interactive* ] [ spec ]
104
+ (` boolean ` ).
105
+
106
+ ## Types
107
+
108
+ This package is fully typed with [ TypeScript] [ ] .
109
+ It exports no additional types.
110
+
111
+ ## Compatibility
112
+
113
+ Projects maintained by the unified collective are compatible with all maintained
114
+ versions of Node.js.
115
+ As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18.0+.
116
+ Our projects sometimes work with older versions, but this is not guaranteed.
66
117
67
118
## Security
68
119
@@ -75,19 +126,19 @@ for [cross-site scripting (XSS)][xss] attacks.
75
126
— check if a node is a (certain) element
76
127
* [ ` hast-util-has-property ` ] ( https://github.com/syntax-tree/hast-util-has-property )
77
128
— check if a node has a property
78
- * [ ` hast-util-is-body-ok-link ` ] ( https://github.com/rehypejs/rehype-minify/tree/HEAD /packages/hast-util-is-body-ok-link )
129
+ * [ ` hast-util-is-body-ok-link ` ] ( https://github.com/rehypejs/rehype-minify/tree/main /packages/hast-util-is-body-ok-link )
79
130
— check if a node is “Body OK” link element
80
- * [ ` hast-util-is-conditional-comment ` ] ( https://github.com/rehypejs/rehype-minify/tree/HEAD /packages/hast-util-is-conditional-comment )
131
+ * [ ` hast-util-is-conditional-comment ` ] ( https://github.com/rehypejs/rehype-minify/tree/main /packages/hast-util-is-conditional-comment )
81
132
— check if a node is a conditional comment
82
- * [ ` hast-util-is-css-link ` ] ( https://github.com/rehypejs/rehype-minify/tree/HEAD /packages/hast-util-is-css-link )
133
+ * [ ` hast-util-is-css-link ` ] ( https://github.com/rehypejs/rehype-minify/tree/main /packages/hast-util-is-css-link )
83
134
— check if a node is a CSS link element
84
- * [ ` hast-util-is-css-style ` ] ( https://github.com/rehypejs/rehype-minify/tree/HEAD /packages/hast-util-is-css-style )
135
+ * [ ` hast-util-is-css-style ` ] ( https://github.com/rehypejs/rehype-minify/tree/main /packages/hast-util-is-css-style )
85
136
— check if a node is a CSS style element
86
137
* [ ` hast-util-embedded ` ] ( https://github.com/syntax-tree/hast-util-embedded )
87
138
— check if a node is an embedded element
88
139
* [ ` hast-util-heading ` ] ( https://github.com/syntax-tree/hast-util-heading )
89
140
— check if a node is a heading element
90
- * [ ` hast-util-is-javascript ` ] ( https://github.com/rehypejs/rehype-minify/tree/HEAD /packages/hast-util-is-javascript )
141
+ * [ ` hast-util-is-javascript ` ] ( https://github.com/rehypejs/rehype-minify/tree/main /packages/hast-util-is-javascript )
91
142
— check if a node is a JavaScript script element
92
143
* [ ` hast-util-labelable ` ] ( https://github.com/syntax-tree/hast-util-labelable )
93
144
— check whether a node is labelable
@@ -104,8 +155,8 @@ for [cross-site scripting (XSS)][xss] attacks.
104
155
105
156
## Contribute
106
157
107
- See [ ` contributing.md ` in ` syntax-tree/.github ` ] [ contributing ] for ways to get
108
- started.
158
+ See [ ` contributing.md ` ] [ contributing ] in [ ` syntax-tree/.github ` ] [ health ] for
159
+ ways to get started.
109
160
See [ ` support.md ` ] [ support ] for ways to get help.
110
161
111
162
This project has a [ code of conduct] [ coc ] .
@@ -146,15 +197,23 @@ abide by its terms.
146
197
147
198
[ npm ] : https://docs.npmjs.com/cli/install
148
199
200
+ [ esm ] : https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
201
+
202
+ [ esmsh ] : https://esm.sh
203
+
204
+ [ typescript ] : https://www.typescriptlang.org
205
+
149
206
[ license ] : license
150
207
151
208
[ author ] : https://wooorm.com
152
209
153
- [ contributing ] : https://github.com/syntax-tree/.github/blob/HEAD/contributing.md
210
+ [ health ] : https://github.com/syntax-tree/.github
211
+
212
+ [ contributing ] : https://github.com/syntax-tree/.github/blob/main/contributing.md
154
213
155
- [ support ] : https://github.com/syntax-tree/.github/blob/HEAD /support.md
214
+ [ support ] : https://github.com/syntax-tree/.github/blob/main /support.md
156
215
157
- [ coc ] : https://github.com/syntax-tree/.github/blob/HEAD /code-of-conduct.md
216
+ [ coc ] : https://github.com/syntax-tree/.github/blob/main /code-of-conduct.md
158
217
159
218
[ hast ] : https://github.com/syntax-tree/hast
160
219
0 commit comments