# simple-entity-decode

> [![npm](https://img.shields.io/npm/v/simple-entity-decode)](https://www.npmjs.com/package/simple-entity-decode) [![npm bundle size](https://img.shields.io/bundlephobia/min/simple-entity-decode)](https://bundlephobia.com/result?p=simple-entity-decode)

Latest version **0.0.3** (published 2019-09-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-entity-decode
pnpm add simple-entity-decode
yarn add simple-entity-decode
bun add simple-entity-decode
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2019-09-04 |
| First published | 2019-08-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Human Made |
| Maintainers | rmccue |

## Links

- npm: https://www.npmjs.com/package/simple-entity-decode
- Homepage: https://github.com/humanmade/simple-entity-decode
- npm.io page: https://npm.io/package/simple-entity-decode

## Recent versions

- 0.0.3 (latest) — 2019-09-04
- 0.0.2 — 2019-08-23
- 0.0.1 — 2019-08-23

## README

# Simple Entity Decode

[![npm](https://img.shields.io/npm/v/simple-entity-decode)](https://www.npmjs.com/package/simple-entity-decode)
[![npm bundle size](https://img.shields.io/bundlephobia/min/simple-entity-decode)](https://bundlephobia.com/result?p=simple-entity-decode)

A tiny library to decode HTML numeric entities and basic XML named entities.

Most entity libraries include complex handling for entities, and include the full list of named entities from the HTML specification. However, most applications and pages don't need this, and can instead normalise entities (e.g. on the server).

Specifically, this library decodes:

* Basic named entities (`&amp;`, `&apos;`, `&quot;`, `&lt;`, `&gt;`)
* Numeric decimal entities (`&#163;`)
* Numeric hexadecimal entities (`&#x000A3;`)

It does **not** handle other named entities. Instead, normalise the entities on the server; for example in WordPress, you can use the [`ent2ncr` function](https://developer.wordpress.org/reference/functions/ent2ncr/).

## Usage

```es6
import decodeEntities from 'simple-entity-decode';

decodeEntities( 'Bill &amp; Ted&#8217;s Excellent Adventure' );
// → "Bill & Ted’s Excellent Adventure"
```

## Licence

Copyright 2019 Human Made. Licensed under the [MIT license](LICENSE.txt).

Uses code from [he by Mathias Bynens](https://github.com/mathiasbynens/he). Used under the MIT license.

---
_Source: https://npm.io/package/simple-entity-decode · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
