he's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
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
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
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
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.