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

decode-named-character-reference

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

decode-named-character-reference

Decode named character references

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.4M
decreased by-3.35%
Maintainers
1
Weekly downloads
 
Created

What is decode-named-character-reference?

The decode-named-character-reference npm package is used to decode named character references (also known as HTML entities) into their corresponding characters. This is particularly useful when dealing with HTML or XML content where special characters are encoded as named entities.

What are decode-named-character-reference's main functionalities?

Decode Named Character Reference

This feature allows you to decode a named character reference into its corresponding character. In this example, the named character reference '&' is decoded to '&'.

const decode = require('decode-named-character-reference');
const decodedString = decode('&');
console.log(decodedString); // Output: &

Decode Multiple Named Character References

This feature allows you to decode multiple named character references within a string. In this example, both '&amp;' and '&lt;' are decoded to '&' and '<' respectively.

const decode = require('decode-named-character-reference');
const decodedString = decode('Hello &amp; welcome to the world of &lt;coding&gt;!');
console.log(decodedString); // Output: Hello & welcome to the world of <coding>!

Other packages similar to decode-named-character-reference

Keywords

FAQs

Package last updated on 02 Jun 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