# jsunescape

> Unescape JavaScript special characters

Latest version **1.0.0** (published 2023-01-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install jsunescape
pnpm add jsunescape
yarn add jsunescape
bun add jsunescape
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-01-03 |
| First published | 2023-01-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Catalina Espinoza |
| Maintainers | cachelina |
| Keywords | unescape, js unescape, escape sequences, special characters, unicode, decode hexidecimal, unescape browser, unescape polyfill |

## Links

- npm: https://www.npmjs.com/package/jsunescape
- Repository: https://github.com/cachelina/jsunescape
- Homepage: https://github.com/cachelina/jsunescape#readme
- Issues: https://github.com/cachelina/jsunescape/issues
- npm.io page: https://npm.io/package/jsunescape

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-01-03

## README

# jsUnescape

> Unescape special characters encoded with [JavaScript escape sequences](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#Using_special_characters_in_strings)

## Install

```
npm install --save jsunescape
```

## Motivation
Since major browsers are planning to drop the [unescape](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/unescape) function in Javascript. This package replicates the original unescape functionality found in V8 to ensure backwards comptaibility.
    
## Usage

`jsunescape` supports:
* JavaScript escape sequences described in the unescape [MDN page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar) such as %XX and %uXXXX (where X represents one hexadecimal digit) with the character that has the hexadecimal value XX/XXXX. If the escape sequence is not a valid escape sequence (for example, if % is followed by one or no hex digit), it is left as-is.




```js
const jsUnescape = require('jsunescape');

console.log(jsUnescape('%u0107'));
// 'ć'


console.log(jsUnescape('%E4%F6%FC'));
// 'äöü'

console.log(jsUnescape('%E4"'));
// 'ä'

console.log(jsUnescape(encodeURIComponent('räksmörgås')));
//'rÃ¤ksmÃ¶rgÃ¥s'
```

## License

MIT © [Catalina Espinoza](http://codedbycat.com)

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