Serialize and encode HTML character references by escaping special characters in a string. Useful for spec-compliant HTML encoding, including support for options such as named references, shortest reference selection, and lighter output via stringifyEntitiesLight.
Project status
- The repository appears to be maintained, with a recent update (4.0.4 on 2024-04-03) focused on a performance refactor in the HTML entity encoding logic.
- The update cadence looks infrequent, with updates at 2024-04-03, then 2022-06-02, then 2021-10-29, suggesting a maintenance style rather than frequent feature releases.
AI summary generated Today
Recent updates
4.0.4
4/3/2024Version 4.0.4 is primarily a performance-oriented refactor of the HTML entity encoding core. The documented change is caching and hoisting regular expressions to reduce repeated RegExp compilation during encoding.
4.0.3
6/2/2022Release 4.0.3 is described only as a fix for a duplicate key in package.json. The actual diff shows that, in addition to that, the project updated tooling configuration, bumped the xo devDependency, and modified README distribution URLs, along with various JSDoc type annotation tweaks.
4.0.2
10/29/2021Release 4.0.2 updates dependencies, tightens typing, and refreshes documentation. The code diff shows several internal refactors related to named references and semicolon omission, plus dependency changes that can affect emitted entity forms.
4.0.1
5/1/2021Release 4.0.1 makes a small typing-related update by adding option types to the exported surface. The only other changes are a minor dev tooling bump (xo) and a small README wording update about ESM usage.
Features4.0.0
3/27/2021Release 4.0.0 converts the package to ESM and introduces JSDoc based typing. The public API is refactored to expose named exports, and an undocumented escape helper is removed.
BreakingFeatures3.1.0
10/19/2020Release 3.1.0 primarily introduces a smaller `light` entrypoint and fixes issues when `subset` contains characters that would break the previous regex construction. The code diff, however, also includes a larger internal refactor that changes packaging layout and some implementation details that could affect edge cases and consumers relying on internal files.
Features3.0.1
5/7/2020Release 3.0.1 primarily updates the TypeScript type definitions so all option fields are optional. The runtime JavaScript logic changes shown in the diff appear to be internal refactors only, with no exported API surface change.
3.0.0
1/14/2020Release 3.0.0 primarily adds TypeScript type definitions for stringify-entities. The code changes also include small internal implementation tweaks in index.js, plus updates to build/test tooling and documentation.
BreakingFeatures2.0.0
1/12/2019Release 2.0.0 primarily changes how numeric HTML character references are chosen when `useShortestReferences` is enabled. Instead of always preferring hexadecimal numeric references, the implementation now also considers decimal numeric references and picks whichever is shorter, accounting for `omitOptionalSemicolons` and the following character.
1.3.2
4/29/2018Release 1.3.2 is primarily a refactor and tooling update. Release notes only mention code-style refactoring and adding a “Related” section to the README, but the diff also includes changes to build and CI scripts plus several dev dependency version bumps.
Features