Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 13, 2024 via pnpm

he 1.2.0

A robust HTML entities encoder/decoder with full Unicode support.
Package summary
Share
0
issues
1
license
1
MIT
Package created
25 Jun 2013
Version published
23 Sep 2018
Maintainers
2
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
he@1.2.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of he 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does he do?

'he' is a robust HTML entity encoder/decoder written in JavaScript, known for its comprehensive support for HTML named character references and Unicode symbols, including astral ones. When it comes to handling ambiguous ampersands and other edge cases, 'he' operates just like a browser would, promising true-to-spec behavior and reliable performance. It is powered by an extensive test suite and stands out from many other JavaScript solutions owing to its adept handling of astral Unicode symbols.

How do you use he?

Using 'he' is quite straightforward, and it can be used in different JavaScript environments, be it Node.js, a web browser, or even Rhino. First, you need to install the package using npm:

npm install he

Then, in a typical Node.js environment, you require 'he' as follows:

var he = require('he');

The main functionality of 'he' comes through its encode and decode methods. You can use encode to encode text into HTML entities:

he.encode('foo Β© bar β‰  baz πŒ† qux');
// The output will be: 'foo © bar ≠ baz 𝌆 qux'

Similarly, you can decode HTML entities back into text using decode:

he.decode('foo © bar ≠ baz 𝌆 qux');
// The output will be: 'foo Β© bar β‰  baz πŒ† qux'

Additional customization can be achieved by using the options object available for both the encode and decode methods.

Where are the he docs?

The documentation for 'he' can be found in the README file of the package on its GitHub repository, which is located at https://github.com/mathiasbynens/he. It includes a thorough walk-through of how to install and use 'he', a detailed explanation of the API and its options, as well as examples for various use cases.