Sniffs the encoding of a buffer, then creates a querying function bound to a document created from the buffer.
The buffer to sniff the encoding of.
Optional
The options to pass to Cheerio.
The loaded document.
import * as cheerio from 'cheerio';const buffer = fs.readFileSync('index.html');const $ = cheerio.loadBuffer(buffer); Copy
import * as cheerio from 'cheerio';const buffer = fs.readFileSync('index.html');const $ = cheerio.loadBuffer(buffer);
Sniffs the encoding of a buffer, then creates a querying function bound to a document created from the buffer.