Socket
Book a DemoInstallSign in
Socket

decode-named-character-reference

Package Overview
Dependencies
Maintainers
1
Versions
5
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

latest
Source
npmnpm
Version
1.2.0
Version published
Weekly downloads
8.6M
-11.03%
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

character

FAQs

Package last updated on 14 Jun 2025

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