Gathering detailed insights and metrics for unescape
Gathering detailed insights and metrics for unescape
Gathering detailed insights and metrics for unescape
Gathering detailed insights and metrics for unescape
npm install unescape
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.7
Supply Chain
99.4
Quality
75
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
39 Stars
12 Commits
13 Forks
4 Watchers
1 Branches
2 Contributors
Updated on Jul 17, 2024
Latest Version
1.0.1
Package Id
unescape@1.0.1
Size
3.54 kB
NPM Version
5.0.3
Node Version
7.7.3
Published on
Jun 08, 2017
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
2
Convert HTML entities to HTML characters, e.g.
>
converts to>
.
Install with npm:
1$ npm install --save unescape
1var decode = require('unescape'); 2 3console.log(decode('<div>abc</div>')); 4//=> '<div>abc</div>' 5 6// get the default entities directly 7console.log(decode.chars);
For performance, this library only handles the following common entities (split into groups for backward compatibility).
Only the following entities are converted by default.
Character | Description | Entity Name | Entity Number |
---|---|---|---|
< | less than | < | < |
> | greater than | > | > |
& | ampersand | & | & |
" | double quotation mark | " | " |
' | single quotation mark (apostrophe) | ' | ' |
Get the default entities as an object:
1console.log(decode.chars);
Only the following entities are converted when 'extras'
is passed as the second argument.
| Character | Description | Entity Name | Entity Number |
| ¢
| cent | ¢
| ¢
|
| £
| pound | £
| £
|
| ¥
| yen | ¥
| ¥
|
| €
| euro | €
| €
|
| ©
| copyright | ©
| ©
|
| ®
| registered trademark | ®
| ®
|
Example:
1// convert only the "extras" characters 2decode(str, 'extras'); 3// get the object of `extras` characters 4console.log(decode.extras);
Convert both the defaults and extras:
1decode(str, 'all');
Get all entities as an object:
1console.log(decode.all);
If you need a more robust implementation, try one of the following libraries:
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
1$ npm install -g verbose/verb#dev verb-generate-readme && verb
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
1$ npm install && npm test
Jon Schlinkert
Copyright © 2017, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on June 04, 2017.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/12 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More