https://github.com/iamakulov/unescape-js
Unescape special characters encoded by JavaScript escape sequences
https://github.com/iamakulov/unescape-js
escape-sequences javascript javascript-escape-sequences string unescape-js
Last synced: 8 months ago
JSON representation
Unescape special characters encoded by JavaScript escape sequences
- Host: GitHub
- URL: https://github.com/iamakulov/unescape-js
- Owner: iamakulov
- License: mit
- Created: 2016-04-15T15:04:54.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T11:05:37.000Z (over 3 years ago)
- Last Synced: 2025-03-31T04:05:59.754Z (over 1 year ago)
- Topics: escape-sequences, javascript, javascript-escape-sequences, string, unescape-js
- Language: JavaScript
- Size: 300 KB
- Stars: 40
- Watchers: 3
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# unescape-js
[](https://www.npmjs.com/package/unescape-js) [](https://travis-ci.org/iamakulov/unescape-js) [](https://coveralls.io/github/iamakulov/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}'));
// 😄
```
## License
MIT © [Ivan Akulov](http://iamakulov.com)