Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
README.md | 2024-08-09 | 2.1 kB | |
v1.0.0 source code.tar.gz | 2024-08-09 | 310.4 kB | |
v1.0.0 source code.zip | 2024-08-09 | 345.0 kB | |
Totals: 3 Items | 657.6 kB | 0 |
Cheerio 1.0 is here! 🎉
Announcement Blog Post
Breaking Changes
- The minimum NodeJS version is now 18.17 or higher https://github.com/cheeriojs/cheerio/pull/3959
- Import paths were simplified. For example, use
cheerio/slim
instead ofcheerio/lib/slim
. https://github.com/cheeriojs/cheerio/pull/3970 - The deprecated default Cheerio instance and static methods were removed. https://github.com/cheeriojs/cheerio/pull/3974
Before, it was possible to write code like this:
```ts import cheerio, { html } from 'cheerio';
html(cheerio('<test></test>')); // ~ '<test></test>' -- NO LONGER WORKS ```
Make sure to always load documents first:
```ts import * as cheerio from 'cheerio';
cheerio.load('<test></test>').html(); ```
-
Node types previously re-exported by Cheerio must now be imported directly from (
domhandler
)(https://github.com/fb55/domhandler). https://github.com/cheeriojs/cheerio/pull/3969 -
htmlparser2 options now reside exclusively under the
xml
key (https://github.com/cheeriojs/cheerio/pull/2916):
ts
const $ = cheerio.load('<html>', {
xml: {
withStartIndices: true,
},
});
New Features
- Add functions to load buffers, streams & URLs in NodeJS by @fb55 in https://github.com/cheeriojs/cheerio/pull/2857
- Add extract method by @fb55 in https://github.com/cheeriojs/cheerio/pull/2750
Fixes
- Allow imports of
cheerio/utils
by @blixt in https://github.com/cheeriojs/cheerio/pull/2601 - Allow empty string in
data
, and simplify by @fb55 in https://github.com/cheeriojs/cheerio/pull/2818 - Make
closest
be able to start from text nodes by @Qualtagh in https://github.com/cheeriojs/cheerio/pull/2811 - Fix potential github action smells by @ceddy4395 in https://github.com/cheeriojs/cheerio/pull/3826
Other
- Cheerio has a new website, featuring updated API docs and guides! https://github.com/cheeriojs/cheerio/pull/2950
Full Changelog: https://github.com/cheeriojs/cheerio/compare/v1.0.0-rc.12...v1.0.0