https://github.com/drylikov/unescape_js
Unescape special characters encoded by JavaScript escape sequences.
https://github.com/drylikov/unescape_js
Last synced: 9 days ago
JSON representation
Unescape special characters encoded by JavaScript escape sequences.
- Host: GitHub
- URL: https://github.com/drylikov/unescape_js
- Owner: drylikov
- License: mit
- Created: 2024-08-03T22:51:00.000Z (9 months ago)
- Default Branch: drylikov
- Last Pushed: 2024-08-03T22:55:22.000Z (9 months ago)
- Last Synced: 2025-03-27T14:05:53.937Z (27 days ago)
- Language: JavaScript
- Size: 78.1 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unescape JS
> 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 Unescape_JS
```
## Usage`unescape-js` supports:
* all JavaScript escape sequences described [on the according MDN page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#Using_special_characters_in_strings) including ES2015 Unicode code point escapes (`\u{XXXXX}`)
* Python-style escape sequences (`\UXXXXXXXX`).```js
var unescapeJs = require('Unescape_JS');console.log(unescapeJs('Hello,\\nworld!'));
// Hello,
// world!console.log(unescapeJs('Copyright \\u00A9'));
// Copyright ©console.log(unescapeJs('\\u{1F604}'));
// 😄
```