Registry / testing / fetch-cheerio-object

fetch-cheerio-object

JSON →
library1.3.0jsnpmunverified

A Node.js module to fetch an HTML page via HTTP and parse it into a cheerio object. It uses node-fetch under the hood for fetching and cheerio for DOM parsing, returning a Promise that resolves to a cheerio instance. The API is simple: pass a URL and optional cheerio.load options. Version 1.3.0 is current. This package is a thin wrapper combining fetch and parse steps, useful for scraping and testing. However, it is unmaintained since 2018 and has known vulnerabilities due to outdated dependencies (node-fetch < 3). Consider using higher-level scraping libraries like got-scraping or axios + cheerio directly for better control and security.

npm install fetch-cheerio-object
INSTALL
IMPORT
SIG · FETCH-CHEERIO-OBJE
F
fetch-cheerio-object
testingjavascriptv1.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const fetchCheerioObject = require('fetch-cheerio-object');
import fetchCheerioObject from 'fetch-cheerio-object';
Package is CommonJS-only, does not support ES modules.
fetchCheerioObject
import fetchCheerioObject from 'fetch-cheerio-object';
ESM import works with bundlers but may fail in pure ESM Node (package has no 'exports' field).
default export
const { default: fetchCheerioObject } = await import('fetch-cheerio-object');
Dynamic import returns a module with default property in CJS interop.

Fetches and parses HTML from a URL, then extracts the title using cheerio.

const fetchCheerioObject = require('fetch-cheerio-object'); (async () => { const $ = await fetchCheerioObject('https://example.com/'); console.log($('title').text()); // Outputs: Example Domain })();
Debug
Known issues
deprecatedPackage is unmaintained since 2018. Dependency node-fetch v2 has known vulnerabilities and is end-of-life.
fix
Migrate to a maintained alternative like got-scraping or axios + cheerio directly.
affects: *
breakingDoes not support ESM imports natively. Attempting 'import fetchCheerioObject from ...' may fail in Node >=12 with type: module.
fix
Use require() or wrap dynamic import with .default.
affects: *
gotchaThe returned cheerio object uses the default pseudo-html parser, not the full HTML parser. Malformed HTML may produce unexpected results.
fix
Pass cheerio options like { xmlMode: true } if needed.
affects: *
gotchaOnly works in Node.js environment; not browser-compatible out of the box.
fix
Use isomorphic cheerio with fetch in browser.
affects: *
Errors
Common errors & fixes
TypeError: fetchCheerioObject is not a function
Using ESM import on a CJS-only module without correct interop.
fix
Use `const fetchCheerioObject = require('fetch-cheerio-object');` or `(await import('...')).default`.
Error: Cannot find module 'node-fetch'
Missing peer dependency node-fetch (or incompatible version).
fix
Install node-fetch@2: `npm install node-fetch@2`.
Error: Cannot find module 'cheerio'
Missing peer dependency cheerio.
fix
Install cheerio: `npm install cheerio`.
Upgrade
Version history
1.3.0latest on npm
Audit
Dependencies
node-fetchrequiredHTTP fetch library
cheeriorequiredHTML parsing and manipulation
Agent activity
2 hits · last 30 days
node
2
Resources
fetch-cheerio-object — npm install fetch-cheerio-object · libregistry