# unescape-es6

> Convert HTML entities to HTML characters, e.g. `&gt;` converts to `>`.

Latest version **2.1.2** (published 2019-03-28) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install unescape-es6
pnpm add unescape-es6
yarn add unescape-es6
bun add unescape-es6
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.1.2 |
| Published | 2019-03-28 |
| First published | 2018-07-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 0 |
| Unpacked size | 12.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Favna |
| Maintainers | favna. |
| Keywords | char, character, characters, entities, entity, escape, html, string, un-escape, unescape, unescape-es6, xml |

## Links

- npm: https://www.npmjs.com/package/unescape-es6
- Repository: https://github.com/favna/unescape-es6
- Issues: https://github.com/favna/unescape-es6/issues
- npm.io page: https://npm.io/package/unescape-es6

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 2.1.2 (latest) — 2019-03-28
- 2.1.1 — 2019-03-28
- 2.1.0 — 2019-02-26
- 2.0.8 — 2019-01-11
- 2.0.7 — 2018-12-10
- 2.0.6 — 2018-12-10
- 2.0.5 — 2018-12-10
- 2.0.4 — 2018-12-08
- 2.0.3 — 2018-12-08
- 2.0.2 — 2018-12-08
- 2.0.1 — 2018-12-08
- 1.1.1 — 2018-11-07
- 1.1.0 — 2018-11-04
- 1.0.5 — 2018-11-04
- 1.0.4 — 2018-11-04
- … 3 more at https://npm.io/package/unescape-es6/versions

## README

<div align="center">
  <p>
  <a href="https://favna.xyz/unescape"><img src="https://storage.googleapis.com/data-sunlight-146313.appspot.com/website-project-icons/unescape.png" height="200" alt="Unescape"/></a>
  </p>

  <p>
<h1> Unescape-es6 </h1>
<h3> Convert HTML entities to HTML characters, e.g. <code>&gt;</code> converts to <code>></code>.</h3>
  </p>

<p>
  <a href="https://depfu.com/repos/Favna/unescape-es6"><img src="https://img.shields.io/depfu/Favna/unescape-es6.svg?style=flat-square" alt="Depfu" title="Depfu" /></a><!--
  --><a href="https://github.com/Favna/unescape-es6/blob/unescape-es6/LICENSE.md"><img src="https://img.shields.io/github/license/favna/unescape-es6.svg?style=flat-square" alt="License" title="License"></a><!--
  --><a href="https://circleci.com/gh/Favna/unescape-es6/tree/master"><img src="https://img.shields.io/circleci/project/github/Favna/unescape-es6/master.svg?style=flat-square" alt="Build Status" title="Build Status" /></a>
</p>

<p>
  <a href="https://www.npmjs.com/package/unescape-es6"><img src="https://img.shields.io/bundlephobia/min/unescape-es6.svg?style=flat-square" alt="NPM bundle size (minified)" title="NPM bundle size (minified)" /></a><!--
  --><a href="https://www.npmjs.com/package/unescape-es6"><img src="https://img.shields.io/bundlephobia/minzip/unescape-es6.svg?style=flat-square" alt="NPM bundle size (minified + gzip)" title="NPM bundle size (minified + gzip)" /></a><!--
  --><a href="https://www.npmjs.com/package/unescape-es6"><img src="https://img.shields.io/npm/v/unescape-es6.svg?style=flat-square" alt="NPM Version" title="NPM Version" /></a><!--
  --><a href="https://www.npmjs.com/package/unescape-es6"><img src="https://img.shields.io/npm/dw/unescape-es6.svg?style=flat-square" alt="NPM Weekly Downloads" title="NPM Weekly Downloads" /></a><!--
  --><a href="https://www.npmjs.com/package/unescape-es6"><img src="https://img.shields.io/npm/dt/unescape-es6.svg?style=flat-square" alt="NPM Total Downloads" title="NPM Total Downloads" /></a>
</p>

<p>
  <a href="https://twitter.com/Favna_/follow"><img src="https://img.shields.io/badge/twitter-follow-brightgreen.svg?logo=twitter&colorB=1DA1F2&style=flat-square&link=https://twitter.com/Favna_/follow" alt="Follow me on Twitter" title="Follow me on Twitter" /></a><!--
  --><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XMAYCF9SDHZ34"><img src="https://img.shields.io/badge/paypal-donate-brightgreen.svg?logo=paypal&colorB=00457C&style=flat-square&link=https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XMAYCF9SDHZ34" alt="Donate with PayPal" title="Donate with PayPal" /></a><!--
  --><a href="https://www.patreon.com/bePatron?u=9336537"><img src="https://img.shields.io/badge/patreon-donate-brightgreen.svg?logo=patreon&colorB=F96854&style=flat-square&link=https://www.patreon.com/bePatron?u=9336537" alt="Become a Patron" title="Become a Patron" /></a>
</p>

<p>
  <a href="https://favna.xyz/redirect/server"><img src="https://discordapp.com/api/guilds/512303595966824458/widget.png?style=banner2" alt="Join Discord Server"/></a>
  <br/>
  <a href="https://nodei.co/npm/unescape-es6"><img src="https://nodei.co/npm/unescape-es6.png" alt="NPM Stats" title="NPM Stats" /></a>
</p>
</div>

---



Based on [unescape](https://www.npmjs.com/package/unescape) from [jonschlinkert](https://github.com/jonschlinkert) but updated for ES6

# Install

Install with [yarn](https://yarnpkg.com):

```sh
$ yarn add unescape
```

# Usage

```js
const { unescape } = require('unescape-es6');
// or for TypeScript:
// import { unescape } from 'unescape-es6';

console.log(unescape('&lt;div&gt;abc&lt;/div&gt;'));
//=> '<div>abc</div>'

// use template tags
console.log(unescape`&lt;div&gt;abc&lt;/div&gt;`); // => '<div>abc</div>'

// or with variables
const unescaped = '&lt;div&gt;unescaped&lt;/div&gt;';
console.log(unescape`awesome text with some ${unescaped} section`); //=> 'awesome text with some <div>unescaped</div> section' 
```

# Characters

For performance, this library only handles the following common entities

Only the following entities are converted by default.

| **Character** | **Description** | **Entity Name** | **Entity Decimal** |    **Entity Hex**   |
| ---  |                 ---                |   ---     |     ---        |          ---        |
| `"`  | double quotation mark              | `&quot;`  | `&#34;`        |        `&#x22;`     |
| `'`  | single quotation mark (apostrophe) | `&apos;`  | `&#39;`        |        `&#x27;`     | 
| `&`  | ampersand                          | `&amp;`   | `&#38;`        |        `&#x26;`     |
| `>`  | greater than                       | `&gt;`    | `&#62;`        |        `&#x3e;`     |
| `<`  | less than                          | `&lt;`    | `&#60;`        |        `&#x3c;`     |
| ` `  | Single regular space               | `&nbsp;`  |  `N.A`         |        `&#xa0;`     |
| `©`  | copyright                          | `&copy;`  | `&#169;`       |        `&#xa9;`     |
| `¢`  | cent                               | `&cent;`  | `&#162;`       |        `&#xa2;`     |
| `®`  | registered trademark               | `&reg;`   | `&#174;`       |        `&#xae;`     |
| `€`  | euro                               | `&euro;`  | `&#8364;`      |        `N.A.`       |
| `£`  | pound                              | `&pound;` | `&#163;`       |        `&#xa3;`     |
| `¥`  | yen                                | `&yen;`   | `&#165;`       |        `&#xa5;`     |

You can also print characters in runtime:

```js
const { charSets } = require('unescape-es6');

console.log(charSets);
```

# About

## Alternatives

If you need a more robust implementation, try one of the following libraries:

- [html-entities](https://www.npmjs.com/package/html-entities)
- [ent](https://www.npmjs.com/package/ent)

## Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://www.github.com/favna/unescape-es6/issues/new).

## License

Copyright © 2018-2019, [Favna](https://github.com/favna).
Released under the [MIT License](LICENSE).

## Buy me a donut

This project is open source and always will be, even if I don't get donations. That said, I know there are people out there that may still want to donate just to show their appreciation so this is for you guys. Thanks in advance!

I accept donations through PayPal, BitCoin, Ethereum and LiteCoin. You can use the buttons below to donate through your method of choice

|Donate With|QR|Address|
|:---:|:---:|:---:|
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XMAYCF9SDHZ34"><img src="https://storage.googleapis.com/data-sunlight-146313.appspot.com/ribbon/paypaldonate.png"></a>|<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XMAYCF9SDHZ34"><img src="https://storage.googleapis.com/data-sunlight-146313.appspot.com/ribbon/paypalqr.png" width="128"></a>|[Donate with PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XMAYCF9SDHZ34)|
<img src="https://storage.googleapis.com/data-sunlight-146313.appspot.com/ribbon/bitcoindonate.png">|<img src="https://storage.googleapis.com/data-sunlight-146313.appspot.com/ribbon/bitcoinqr.png" width="128">|<a href="bitcoin:1E643TNif2MTh75rugepmXuq35Tck4TnE5?amount=0.01&label=Favna%27%20Ribbon%20Discord%20Bot">1E643TNif2MTh75rugepmXuq35Tck4TnE5</a>|
<img src="https://storage.googleapis.com/data-sunlight-146313.appspot.com/ribbon/ethereumdonate.png">|<img src="https://storage.googleapis.com/data-sunlight-146313.appspot.com/ribbon/ethereumqr.png" width="128">|<a href="ethereum:0xF653F666903cd8739030D2721bF01095896F5D6E?amount=0.01&label=Favna%27%20Ribbon%20Discord%20Bot">0xF653F666903cd8739030D2721bF01095896F5D6E</a>|
<img src="https://storage.googleapis.com/data-sunlight-146313.appspot.com/ribbon/litecoindonate.png">|<img src="https://storage.googleapis.com/data-sunlight-146313.appspot.com/ribbon/litecoinqr.png" width="128">|<a href="litecoin:LZHvBkaJqKJRa8N7Dyu41Jd1PDBAofCik6?amount=0.01&label=Favna%27%20Ribbon%20Discord%20Bot">LZHvBkaJqKJRa8N7Dyu41Jd1PDBAofCik6</a>|

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