On this page
Overview
Cheerio loads HTML or XML into a lightweight DOM model and exposes jQuery-like selectors for querying, modifying, and serializing markup. It uses parse5 by default and can also use htmlparser2, making it useful for server-side scraping and markup transformation without a full browser DOM.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Load markup and work with elements through jQuery-style selectors
Use cheerio.load() to parse markup, then query with $() and read or change text, attributes, classes, and structure before serializing the result back to HTML.
Sources: [2]
Best fit
Fits scraping and server-side markup transformation that does not need a full browser
It works well for selector-based extraction, cleanup, and structural changes when layout, rendering, navigation, and other browser APIs are unnecessary.
Sources: [2]
Before adoption
Treat it as a lightweight DOM model rather than a browser engine
Cheerio does not reproduce browser layout, navigation, or JavaScript execution. Tests or scraping workflows that need browser behavior should use jsdom or real-browser automation where appropriate.
Sources: [2]
Official sources
- [1]cheeriojs/cheerio repository(2026-09-30)
- [2]Cheerio README(2026-09-30)
- [3]Cheerio 1.2.0 package metadata(2026-09-30)
- [4]Cheerio v1.2.0 release(2026-09-30)
- [5]Cheerio MIT license(2026-09-30)
Supplemental curator note
Cheerio is designed for lightweight HTML and XML parsing rather than browser layout or script execution. Version 1.2.0 requires Node.js 22.19 or newer, so existing scraping jobs and CI runtimes should be checked before upgrading.
Try it in 3 steps
- 1
Install Cheerio 1.2.0
Pin the stable release in a project running Node.js 22.19 or newer.
npm install cheerio@1.2.0 - 2
Load HTML
Parse markup into Cheerio’s lightweight DOM model using the documented load API.
import * as cheerio from 'cheerio'; const $ = cheerio.load('<h2 class="title">Hello</h2>'); - 3
Query and modify elements
Use jQuery-style selectors to update the document and inspect the serialized HTML.
$('h2.title').text('Hello there!'); console.log($.html());
Growth
Growth trends · Last 30 days
30,513 Stars
Trend data is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- cheerio
- dom
- hacktoberfest
- html
- htmlparser
- htmlparser2
- jquery
- parser
- scraper
- selector
- Stars
- 30,513
- Forks
- 1,722
- Watchers
- 347
- Open issues
- 70
- Owner type
- Organization
- Primary language
- TypeScript
- License
- MIT
- Repository last updated
- Sep 30, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Knip12,379 Stars
3 shared tag(s) · 1 shared category(s) · Same language
find unused files, dependencies, and exports across JavaScript and TypeScript projects
TypeScript - Markuplint619 Stars
3 shared tag(s) · 1 shared category(s) · Same language
lint markup against HTML and ARIA rules across HTML, React, Vue, Svelte, and other templates
TypeScript - Prettier52,319 Stars
3 shared tag(s) · 1 shared category(s)
an opinionated formatter that parses code and reprints a consistent style
JavaScript - jsdom21,695 Stars
3 shared tag(s) · 1 shared category(s)
emulate a subset of DOM and HTML standards in Node.js for testing and scraping
JavaScript - Auth.js28,372 Stars
3 shared tag(s) · Same language
Compose OAuth/OIDC, passwordless, WebAuthn, and stateless or database-backed sessions from packages built around standard Web APIs
TypeScript - Storybook91,178 Stars
2 shared tag(s) · 1 shared category(s) · Same language
capture UI states once and reuse them across docs, interaction tests, and agent tooling
TypeScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.