</>PackageGraphPackageGraph

cheerio

npmv1.2.0TypeScript

The 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.

11
Direct dependencies

Runtime packages this one declares itself.

18
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

4.7 MB
Install size

Unpacked size of this package plus its entire runtime tree.

3
Tree depth

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

BSD-2-ClauseISCMIT

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.

PackageWeekly downloadsDependentsLicenseLast release
cheeriothis page24.1M5MIT7 months ago
fast-xml-parser04MIT1 day ago
dom-serializer94.3M2MIT1 day ago
plist14M2MIT1 day ago
happy-dom06MIT1 day ago
w3c-xmlserializer01MIT1 day ago

Dependencies

Declared by cheerio v1.2.0. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (27)

@eslint/compat ^2.0.1@eslint/js ^9.38.0@imgix/js-core ^3.8.0@octokit/graphql ^9.0.3@types/jsdom ^27.0.0@types/node ^25.0.10@types/whatwg-mimetype ^3.0.2@vitest/coverage-v8 ^4.0.18@vitest/eslint-plugin ^1.6.6eslint ^9.39.2eslint-config-prettier ^10.1.8eslint-plugin-jsdoc ^62.3.1eslint-plugin-n ^17.23.2eslint-plugin-unicorn ^62.0.0globals ^17.1.0husky ^9.1.7jquery ^4.0.0jsdom ^27.4.0lint-staged ^16.2.7prettier ^3.8.1prettier-plugin-jsdoc ^1.8.0tinybench ^6.0.0tshy ^3.1.0tsx ^4.21.0typescript ^5.9.3typescript-eslint ^8.53.1vitest ^4.0.16

Used by

Popular packages that depend on cheerio.

Relationship graph

Dependencies (left) and dependents (right) of cheerio.

Frequently installed together

Release history

4 releases in the last two years, typically about 108 days apart.

Recent versions of cheerio
VersionPublishedSizeLicense
1.2.0latest7 months ago988 KBMIT
1.1.21 year ago1.2 MBMIT
1.1.11 year ago1.2 MBMIT
1.1.01 year ago1.2 MBMIT
1.0.02 years ago1.2 MBMIT
1.0.0-rc.124 years ago545 KBMIT
1.0.0-rc.114 years ago545 KBMIT
1.0.0-rc.105 years ago199 KBMIT
1.0.0-rc.95 years ago228 KBMIT
1.0.0-rc.85 years ago232 KBMIT
1.0.0-rc.75 years ago41 KBMIT
1.0.0-rc.65 years ago150 KBMIT
1.0.0-rc.55 years ago139 KBMIT
1.0.0-rc.45 years ago139 KBMIT
1.0.0-rc.37 years ago109 KBMIT

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

Keywords

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.