Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

entities

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

entities

Encode & decode XML and HTML entities with ease & speed

  • 4.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
60M
increased by2.91%
Maintainers
1
Weekly downloads
 
Created

What is entities?

The 'entities' npm package is a library that helps with encoding and decoding HTML entities. It is useful for dealing with HTML data in text form and can be used to prevent XSS attacks by sanitizing input or output.

What are entities's main functionalities?

Encode HTML Entities

Encodes special characters in a string to their corresponding HTML entities. Useful for displaying text on a webpage without it being interpreted as HTML.

"require('entities').encodeHTML('<div>Hello & welcome!</div>');"

Decode HTML Entities

Decodes HTML entities back to their original characters. This is useful for processing text that contains HTML entities and converting them to their readable form.

"require('entities').decodeHTML('&lt;div&gt;Hello &amp; welcome!&lt;/div&gt;');"

Encode XML Entities

Similar to encoding HTML entities, but specifically for XML, which has a smaller set of entities.

"require('entities').encodeXML('<note>Priority & importance</note>');"

Decode XML Entities

Decodes XML entities back to their original characters, which is useful when working with XML data.

"require('entities').decodeXML('&lt;note&gt;Priority &amp; importance&lt;/note&gt;');"

Other packages similar to entities

Keywords

FAQs

Package last updated on 02 Apr 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc