Socket
Socket
Sign inDemoInstall

unescape

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    unescape

Convert the HTML entities in a string to their corresponding HTML characters, e.g. `>` converts to `>`.


Version published
Weekly downloads
718K
decreased by-5.79%
Maintainers
1
Install size
7.04 kB
Created
Weekly downloads
 

Readme

Source

unescape NPM version

Convert the HTML entities in a string to their corresponding HTML characters, e.g. > converts to >.

Install

Install with npm:
npm i unescape --save-dev

Run tests

npm test

Usage

var unescape = require('unescape');
console.log(unescape('<div>abc</div>'));
//=> '<div>abc</div>'
  • &#39; converts to '
  • &amp; converts to &
  • &gt; converts to >
  • &lt; converts to <
  • &quot; converts to "

Get the characters/entities:

console.log(unescape.chars);

returns

{
  '&#39;': '\'',
  '&amp;': '&',
  '&gt;': '>',
  '&lt;': '<',
  '&quot;': '"'
}

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license


This file was generated by verb-cli on September 14, 2014.

Keywords

FAQs

Last updated on 14 Sep 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc