Skip to content

Commit 7e9a44c

Browse files
committed
Update docs
1 parent 3991a2e commit 7e9a44c

File tree

1 file changed

+76
-7
lines changed

1 file changed

+76
-7
lines changed

readme.md

Lines changed: 76 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,55 @@
66
[![Size][size-badge]][size]
77

88
List of HTML void tag names.
9-
Includes ancient (such as `nextid` and `basefont`) and modern (such as `img` and
10-
`meta`) tag names from the HTML living standard.
119

12-
## Install
10+
## Contents
11+
12+
* [What is this?](#what-is-this)
13+
* [When should I use this?](#when-should-i-use-this)
14+
* [Install](#install)
15+
* [Use](#use)
16+
* [API](#api)
17+
* [`htmlVoidElements`](#htmlvoidelements)
18+
* [Types](#types)
19+
* [Compatibility](#compatibility)
20+
* [Security](#security)
21+
* [Related](#related)
22+
* [Contribute](#contribute)
23+
* [License](#license)
24+
25+
## What is this?
26+
27+
This is a list of all void tag names according to HTML.
1328

14-
This package is ESM only: Node 12+ is needed to use it and it must be `import`ed
15-
instead of `require`d.
29+
> 👉 **Note**: Includes ancient (such as `nextid` and `basefont`) tag names too.
30+
31+
## When should I use this?
32+
33+
You can use this when you’re writing HTML parsers, minifiers, or compilers.
34+
35+
## Install
1636

17-
[npm][]:
37+
This package is [ESM only][esm].
38+
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:
1839

1940
```sh
2041
npm install html-void-elements
2142
```
2243

44+
In Deno with [Skypack][]:
45+
46+
```js
47+
import {htmlVoidElements} from 'https://cdn.skypack.dev/html-void-elements@2?dts'
48+
```
49+
50+
In browsers with [Skypack][]:
51+
52+
```html
53+
<script type="module">
54+
import {htmlVoidElements} from 'https://cdn.skypack.dev/html-void-elements@2?min'
55+
</script>
56+
```
57+
2358
## Use
2459

2560
```js
@@ -65,7 +100,33 @@ There is no default export.
65100

66101
### `htmlVoidElements`
67102

68-
`string[]` — List of lowercase tag names.
103+
List of HTML void tag names (`Array<string>`).
104+
105+
## Types
106+
107+
This package is fully typed with [TypeScript][].
108+
109+
## Compatibility
110+
111+
This package is at least compatible with all maintained versions of Node.js.
112+
As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
113+
It also works in Deno and modern browsers.
114+
115+
## Security
116+
117+
This package is safe.
118+
119+
## Related
120+
121+
* [`wooorm/html-tag-names`](https://github.com/wooorm/html-tag-names)
122+
— list of HTML tag names
123+
* [`wooorm/html-element-attributes`](https://github.com/wooorm/html-element-attributes)
124+
— map of HTML elements to attributes
125+
126+
## Contribute
127+
128+
Yes please!
129+
See [How to Contribute to Open Source][contribute].
69130

70131
## License
71132

@@ -91,6 +152,14 @@ There is no default export.
91152

92153
[npm]: https://docs.npmjs.com/cli/install
93154

155+
[skypack]: https://www.skypack.dev
156+
94157
[license]: license
95158

96159
[author]: https://wooorm.com
160+
161+
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
162+
163+
[typescript]: https://www.typescriptlang.org
164+
165+
[contribute]: https://opensource.guide/how-to-contribute/

0 commit comments

Comments
 (0)