Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Nov 1, 2021
1 parent b63cfa6 commit e57e03f
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "html-encodings",
"version": "3.0.0",
"description": "List of known HTML character encoding labels",
"description": "Info on HTML character encodings",
"license": "MIT",
"keywords": [
"html",
Expand Down
79 changes: 72 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,57 @@
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]

Info on known HTML character encodings labels, from the [spec][].
Info on HTML character encodings.

## Install
## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`list`](#list)
* [`groups`](#groups)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package contains info on HTML character encoding labels.
These are defined by the [Encoding spec][spec].

This package is ESM only: Node 12+ is needed to use it and it must be `import`ed
instead of `require`d.
## When should I use this?

Maybe when you’re writing an HTML parser, minifier, or formatter, otherwise
probably never!

## Install

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

```sh
npm install html-encodings
```

In Deno with [Skypack][]:

```js
import * as htmlEncodings from 'https://cdn.skypack.dev/html-encodings@3?dts'
```

In browsers with [Skypack][]:

```html
<script type="module">
import * as htmlEncodings from 'https://cdn.skypack.dev/html-encodings@3?min'
</script>
```

## Use

```js
Expand Down Expand Up @@ -66,10 +104,29 @@ List of all encodings (`Array<string>`).
Map of group labels to lists of synonymous encodings
(`Record<string, Array<string>>`).

## Types

This package is fully typed with [TypeScript][].

## Compatibility

This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
It also works in Deno and modern browsers.

## Security

This package is safe.

## Related

* [`html-dangerous-encodings`](https://github.com/wooorm/html-dangerous-encodings)
— List of dangerous HTML character encoding labels
* [`wooorm/html-dangerous-encodings`](https://github.com/wooorm/html-dangerous-encodings)
— list of dangerous HTML character encoding labels

## Contribute

Yes please!
See [How to Contribute to Open Source][contribute].

## License

Expand All @@ -95,8 +152,16 @@ Map of group labels to lists of synonymous encodings

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

[skypack]: https://www.skypack.dev

[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/

[spec]: https://encoding.spec.whatwg.org/#names-and-labels

0 comments on commit e57e03f

Please # to comment.