Repository navigation
v2.0.0-beta.1 — Stable Cheerio upgrade
Pre-release
Pre-release
This prerelease upgrades truncate-html to stable Cheerio 1.2.0 while preserving its truncation API and parse5 HTML parsing behavior.
Changes
- Upgrade Cheerio from 1.0.0-rc.12 to 1.2.0 and declare domhandler as a direct dependency for public DOM types.
- Preserve truncate(), truncate.setup(), customNodeStrategy, option names and existing CommonJS/ES module entry points.
- Correct README examples and verify their documented outputs automatically.
- Add migration guidance, packed-package consumer checks and a Node 20/22/24 CI matrix.
Compatibility
- Node.js 20.18.1 or newer is required.
- Applications that directly use Cheerio instances or types should upgrade their own Cheerio dependency to 1.2.0. DOM node types such as AnyNode now come from domhandler.
- decodeEntities remains accepted but is deprecated: string input continues to decode entities using parse5 regardless of this option, matching the actual 1.x behavior.
Validation
All 94 tests pass, including README examples and parser compatibility regressions. Type checking, lint, build and packed-package CommonJS, native ESM, bundled module-entry and TypeScript consumer checks pass.
Install
npm install truncate-html@2.0.0-beta.1The npm beta tag points to 2.0.0-beta.1; latest remains 1.2.2. See MIGRATION.md for details.