entities
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
The JavaScript npm package "entities" is a high-speed utility used for encoding and decoding XML and HTML entities with flexibility and accuracy. It's proven reliable over time, with widespread usage by prominent libraries such as htmlparser2
, the official AWS SDK, and commonmark
. It stands out with its speed, regularly outperforming rival libraries in performance benchmarks. It offers configuration options for output customization, making it adaptable to specific developer needs, be it UTF8 or ASCII character coding.
Using "entities" is fairly straightforward. After installing the package with npm install entities
, you can include it in your JavaScript project with const entities = require("entities")
. Encoding and decoding operations can be performed by calling corresponding methods on the entities
object. Here's a brief example:
// Encoding
console.log(entities.escapeUTF8("& ü")); // "& ü"
console.log(entities.encodeXML("& ü")); // "& ü"
console.log(entities.encodeHTML("& ü")); // "& ü"
// Decoding
console.log(entities.decodeXML("asdf & ÿ ü '")); // "asdf & ÿ ü '"
console.log(entities.decodeHTML("asdf & ÿ ü '")); // "asdf & ÿ ü '"
As of now, the provided README content serves as the primary documentation for the "entities" package. This document explains the purpose of the package, its features and perks, how to install and use the package, and includes insights on performance benchmarks and Frequently Asked Questions. For the latest, most thorough information on using "entities", refer to the README on the official GitHub repository at git://github.com/fb55/entities.git
.