cheerio
npmv1.2.0TypeScriptThe fast, flexible & elegant library for parsing and manipulating HTML and XML.
Safe to adopt
Yes — cheerio scores well across adoption, maintenance, weight, supply chain, and licensing. 24.1M downloads per week and 5 known dependents. Last published 229 days ago. 4 releases in the last 2 years.
- AAdoption: grade A, Excellent.
24.1M downloads per week and 5 known dependents.
- BMaintenance: grade B, Good.
Last published 229 days ago. 4 releases in the last 2 years.
- BWeight: grade B, Good.
Pulls in 18 transitive packages, about 4.7 MB installed (at least — some of the tree is still being crawled).
- ASupply chain: grade A, Excellent.
No install scripts, 2 maintainers, and a contained dependency surface.
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding cheerio to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Part of this dependency tree has not been crawled yet, so these figures are a lower bound rather than a final total.
Licenses in the dependency tree
Every license you inherit by installing cheerio, not just its own. Check this before a legal review, not after.
Compatibility
- Node.js
- node >=20.18.1
- Module format
- ESM + CommonJS
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the cheerio README.
import * as cheerio from 'cheerio';
const $ = cheerio.load('<h2 class="title">Hello world</h2>');
$('h2.title').text('Hello there!');
$('h2').addClass('welcome');
$.html();
//=> <html><head></head><body><h2 class="title welcome">Hello there!</h2></body></html>cheerio vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| cheeriothis page | 24.1M | 5 | MIT | 7 months ago |
| fast-xml-parser | 0 | 4 | MIT | 1 day ago |
| dom-serializer | 94.3M | 2 | MIT | 1 day ago |
| plist | 14M | 2 | MIT | 1 day ago |
| happy-dom | 0 | 6 | MIT | 1 day ago |
| w3c-xmlserializer | 0 | 1 | MIT | 1 day ago |
Dependencies
Declared by cheerio v1.2.0. Runtime dependencies are installed with the package; dev dependencies are not.
Runtime (11)
Dev (27)
Used by
Popular packages that depend on cheerio.
An AST-based pattern checker for JavaScript.
render domhandler DOM nodes to a string
Mongoose MongoDB ODM
Next-gen browser and mobile automation test framework for Node.js
libSQL Wasm packaged as an ES module.
Relationship graph
Dependencies (left) and dependents (right) of cheerio.
Frequently installed together
TypeScript definitions for node
A high-level API to control headless Chrome over the DevTools Protocol
An AST-based pattern checker for JavaScript.
the most correct and second fastest glob implementation in JavaScript
Runtime typescript and ESM support for Node.js
Check if a value is a plain object
A simple list of CSS shorthand properties and which longhand properties they expand to
html formatter yo! Prettify or minify html.
TypeScript definitions for @sinonjs/fake-timers
Programmatic access to the ARIA specification
A WDIO helper utility to provide a repl interface for WebdriverIO
Create, read and edit .zip files with JavaScript http://stuartk.com/jszip
Release history
4 releases in the last two years, typically about 108 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 1.2.0latest | 7 months ago | 988 KB | MIT |
| 1.1.2 | 1 year ago | 1.2 MB | MIT |
| 1.1.1 | 1 year ago | 1.2 MB | MIT |
| 1.1.0 | 1 year ago | 1.2 MB | MIT |
| 1.0.0 | 2 years ago | 1.2 MB | MIT |
| 1.0.0-rc.12 | 4 years ago | 545 KB | MIT |
| 1.0.0-rc.11 | 4 years ago | 545 KB | MIT |
| 1.0.0-rc.10 | 5 years ago | 199 KB | MIT |
| 1.0.0-rc.9 | 5 years ago | 228 KB | MIT |
| 1.0.0-rc.8 | 5 years ago | 232 KB | MIT |
| 1.0.0-rc.7 | 5 years ago | 41 KB | MIT |
| 1.0.0-rc.6 | 5 years ago | 150 KB | MIT |
| 1.0.0-rc.5 | 5 years ago | 139 KB | MIT |
| 1.0.0-rc.4 | 5 years ago | 139 KB | MIT |
| 1.0.0-rc.3 | 7 years ago | 109 KB | MIT |
Overview
cheerio is an npm package that the fast, flexible & elegant library for parsing and manipulating HTML and XML. It is extremely widely used, with about 24.1M downloads per week and 5 known dependents in the graph. The latest version is 1.2.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need the fast, flexible & elegant library for parsing and manipulating HTML and XML and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to minimize your dependency tree, or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (24.1M weekly downloads).
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- Large dependency tree (38 direct dependencies) increases install size and audit surface.
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Funding
Frequently asked questions
Should I use cheerio?
Yes — cheerio scores well across adoption, maintenance, weight, supply chain, and licensing. 24.1M downloads per week and 5 known dependents. Last published 229 days ago. 4 releases in the last 2 years.
How do I install cheerio?
Run `npm install cheerio` to add cheerio to your npm project.
How many dependencies does cheerio have?
cheerio declares 38 direct dependencies and pulls in 18 packages in total once its runtime tree is resolved totalling about 4.7 MB on disk.
What license is cheerio released under?
cheerio is distributed under the MIT license. Its dependency tree also includes: BSD-2-Clause, ISC, MIT.
How popular is cheerio?
cheerio has approximately 24,078,503 downloads per week and 5 known dependent packages.
Is cheerio still maintained?
The most recent release of cheerio (v1.2.0) was published 7 months ago.
Does cheerio run install scripts?
No. cheerio does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.