Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wooorm/html-tag-names
List of known HTML tag names
https://github.com/wooorm/html-tag-names
element html name tag
Last synced: 14 days ago
JSON representation
List of known HTML tag names
- Host: GitHub
- URL: https://github.com/wooorm/html-tag-names
- Owner: wooorm
- License: mit
- Created: 2016-03-17T14:55:29.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2023-11-01T11:34:10.000Z (about 1 year ago)
- Last Synced: 2024-10-25T15:28:15.189Z (19 days ago)
- Topics: element, html, name, tag
- Language: JavaScript
- Homepage:
- Size: 80.1 KB
- Stars: 62
- Watchers: 4
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: funding.yml
- License: license
Awesome Lists containing this project
README
# html-tag-names
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]List of known HTML tag names.
## Contents
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`htmlTagNames`](#htmltagnames)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)## What is this?
This is a list of HTML tag names.
It includes ancient (for example, `nextid` and `basefont`) and modern (for
example, `search` and `shadow`) names from the HTML living standard.
The repo includes scripts to regenerate the data from the specs.## When should I use this?
You can use this package when you need to know what tag names are allowed in
any version of HTML.## Install
This package is [ESM only][esm].
In Node.js (version 14.14+, 16.0+), install with [npm][]:```sh
npm install html-tag-names
```In Deno with [`esm.sh`][esmsh]:
```js
import {htmlTagNames} from 'https://esm.sh/html-tag-names@2'
```In browsers with [`esm.sh`][esmsh]:
```html
import {htmlTagNames} from 'https://esm.sh/html-tag-names@2?bundle'
```
## Use
```js
import {htmlTagNames} from 'html-tag-names'console.log(htmlTagNames.length) // => 148
console.log(htmlTagNames.slice(0, 20))
```Yields:
```js
[
'a',
'abbr',
'acronym',
'address',
'applet',
'area',
'article',
'aside',
'audio',
'b',
'base',
'basefont',
'bdi',
'bdo',
'bgsound',
'big',
'blink',
'blockquote',
'body',
'br'
]
```## API
This package exports the identifier `htmlTagNames`.
There is no default export.### `htmlTagNames`
List of known (lowercase) HTML tag names (`Array`).
## Types
This package is fully typed with [TypeScript][].
It exports no additional types.## Compatibility
This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 14.14+ and 16.0+.
It also works in Deno and modern browsers.## Security
This package is safe.
## Related
* [`wooorm/mathml-tag-names`](https://github.com/wooorm/mathml-tag-names)
— list of MathML tag names
* [`wooorm/svg-tag-names`](https://github.com/wooorm/svg-tag-names)
— list of SVG tag names
* [`jgierer12/react-tag-names`](https://github.com/jgierer12/react-tag-names)
— list of React’s HTML and SVG tag names
* [`wooorm/svg-element-attributes`](https://github.com/wooorm/svg-element-attributes)
— map of SVG elements to attributes
* [`wooorm/html-element-attributes`](https://github.com/wooorm/html-element-attributes)
— map of HTML elements to attributes
* [`wooorm/aria-attributes`](https://github.com/wooorm/aria-attributes)
— list of ARIA attributes## Contribute
Yes please!
See [How to Contribute to Open Source][contribute].## License
[MIT][license] © [Titus Wormer][author]
[build-badge]: https://github.com/wooorm/html-tag-names/workflows/main/badge.svg
[build]: https://github.com/wooorm/html-tag-names/actions
[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/html-tag-names.svg
[coverage]: https://codecov.io/github/wooorm/html-tag-names
[downloads-badge]: https://img.shields.io/npm/dm/html-tag-names.svg
[downloads]: https://www.npmjs.com/package/html-tag-names
[size-badge]: https://img.shields.io/bundlephobia/minzip/html-tag-names.svg
[size]: https://bundlephobia.com/result?p=html-tag-names
[npm]: https://docs.npmjs.com/cli/install
[esmsh]: https://esm.sh
[license]: license
[author]: https://wooorm.com
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
[typescript]: https://www.typescriptlang.org
[contribute]: https://opensource.guide/how-to-contribute/