Releases: fb55/entities
Releases · fb55/entities
v3.0.1
v3.0.0
[email protected]
features more configurable encode
and decode
functions and rewritten decode & encode functions, resulting in a huge speedup.
New Features:
- feat: Add new API for
encode
,decode
functions 817ae67
You can now pass an object with additional configuration options to the exported encode
and decode
function. You can still use the relevant function directly, but this will make it easier to figure out what you want to do in the first place!
Refactors:
- refactor(encode): Use trie for encoding (#559) f6f7cd9
- refactor(decode): Use serialised binary trie for decoding (#556, #557) 267d32e c038c63
entities
is now using tries for encoding and decoding entities. Especially when decoding, this leads to considerable performance improvements. The simple benchmark in scripts/benchmark.ts
is useful for comparing the performance of these two versions:
Version | decode perf |
encode perf |
escape perf |
---|---|---|---|
3.0.0 | 1.418s | 6.786s | 2.196s |
2.2.0 | 4.085s | 14.842s | 5.166s |
Speedup | 2.9x | 2.1x | 2.4x |
Heroes of this release:
- @inikulin for his work on binary decoding tries for the parse5 project, which was the basis for the decode trie implemented in this project.
- @mdevils for being a great opponent in entity library performance.
entities
was the fastest library in the space for a while. The friendly competition was a great reason to come up with smarter algorithms to push the envelope just a bit further. Nowentities
is on top again, but we'll see how long that lasts!
v2.2.0
- Add
encodeNonAsciiHTML
function 03b9143- Bit of a mouthful, but probably what most users expect; same as
encodeHTML
, but skips characters that are perfectly valid in ASCII and HTML.
- Bit of a mouthful, but probably what most users expect; same as
- Add
escapeUTF8
function 1ea2418- Useful for escaping content in a space-saving manner, when charsets aren't an issue.
- Use string codepoint methods when available 1e5aa22
- Restores compatibility with Node < 4.
- Add doc comments for most methods, deprecate some methods 8b1bc21
v2.1.0
- Minified built-in JSON maps (#305 by @fabiospampinato) 97ebff3
- chore(lint): Add eslint-plugin-node 714d70d
v2.0.3
v2.0.2
v2.0.1
Port to TypeScript, modernize
The public-facing API should be identical