NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #1304 most downloaded on npm
Fastest HTML entities encode/decode library.
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 2 weeks to 3.0 years
Some releases are documented
notes for 18 of 47 stable releases
1 version withdrawn
withdrawn after publishing
14 years old
48 releases · first in 2013
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Include source maps into the npm package.
Introduce nonAsciiPrintableOnly mode.
nonAsciiPrintableOnly mode.Nothing published for this version
Reduce unnecessarily long RegExps.
Fix the problem decoding HTML5 entities those names are part of HTML4 entities.
package.json: specify sideEffects: false
package.json: specify sideEffects: false
Minimize data files, remove unnecessary files.
Minimize data files, remove unnecessary files.
Improve performance of encode(), decode() and decodeEntity() by using function inlining.
encode(), decode() and decodeEntity() by using function inlining.* Add flow types.
A fast decodeEntity() method to decode a single HTML entity.
A fast decodeEntity() method to decode a single HTML entity.
Speed up both encode() and decode() methods.
encode() and decode() methods.Add extensive mode to encode() method. This mode encodes all non-printable characters, non-ASCII characters and all characters with named references.
extensive mode to encode() method. This mode encodes all non-printable characters, non-ASCII characters and all characters with named references.Handle invalid numeric HTML entities: mimic browser behaviour.
Handling behaviour of ambiguous ampersands.
* Fix webpack build warning.
Handle invalid numeric HTML entities.
Handle null and undefined text values.
null and undefined text values.Fix decoding numeric HTML entities.
Performance was greatly improved.
Performance was greatly improved.
New API: simpler and more flexible.
htmlEntitiesInstance.encode(text) -> encode(text)
Before:
import {AllHtmlEntities} from 'html-entities';
const entities = new AllHtmlEntities();
console.log(
entities.encode('<Hello & World>')
);
After:
import {encode} from 'html-entities';
console.log(
encode('<Hello & World>')
);
instance.encodeNonASCII(text) -> encode(text, {mode: 'nonAscii'})
Before:
import {AllHtmlEntities} from 'html-entities';
const entities = new AllHtmlEntities();
console.log(
entities.encodeNonASCII('& © ∆')
);
After:
import {encode} from 'html-entities';
console.log(
encode('& © ∆', {mode: 'nonAscii'})
);
instance.encodeNonASCII(text) -> encode(text, {mode: 'nonAsciiPrintable'})
Before:
import {AllHtmlEntities} from 'html-entities';
const entities = new AllHtmlEntities();
console.log(
entities.encodeNonASCII('& © ∆ \x01')
);
After:
import {encode} from 'html-entities';
console.log(
encode('& © ∆ \x01', {mode: 'nonAsciiPrintable'})
);
instance.decode(text) -> decode(text)
Before:
import {AllHtmlEntities} from 'html-entities';
const entities = new AllHtmlEntities();
console.log(
entities.decode('<>&')
);
After:
import {decode} from 'html-entities';
console.log(
decode('<>&')
);
Different XML/HTML versions are now implemented via options instead of different classes.
Before:
import {XmlEntities, Html4Entities, Html5Entities, AllHtmlEntities} from 'html-entities';
const xmlEntities = new XmlEntities();
const html4Entities = new Html4Entities();
const html5Entities = new Html5Entities();
const allHtmlEntities = new AllHtmlEntities();
console.log(xmlEntities.encode('<>&'));
console.log(html4Entities.encode('<>&©'));
console.log(html5Entities.encode('<>&©℞'));
console.log(allHtmlEntities.encode('<>&©℞'));
console.log(xmlEntities.decode('<>&'));
console.log(html4Entities.decode('<>&©'));
console.log(html5Entities.decode('<>&©℞'));
console.log(allHtmlEntities.decode('<>&©℞'));
After:
import {encode, decode} from 'html-entities';
console.log(encode('<>&', {level: 'xml'}));
console.log(encode('<>&©', {level: 'html4', mode: 'nonAscii'}));
console.log(encode('<>&©℞', {level: 'html5', mode: 'nonAscii'}));
console.log(encode('<>&©℞', {level: 'all', mode: 'nonAscii'}));
console.log(decode('<>&', {level: 'xml'}));
console.log(decode('<>&©', {level: 'html4'}));
console.log(decode('<>&©℞', {level: 'html5'}));
console.log(decode('<>&©℞', {level: 'all'}));
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →