1.0.0
Cheerio - Porting Cheerio Node Module To Deno using esm.sh
Attributes
Includes Deno configuration
Repository
Current version released
2 years ago
Dependencies
esm.sh
Versions
Deno Cheerio
Cheerio - Porting Cheerio Node Module To Deno using esm.sh
Prerequisites
- Deno on your System https://deno.land/#installation
Usage
- Cheerio Full Docs and usage - https://cheerio.js.org/
import { cheerio } from "https://deno.land/x/denocheerio/mod.ts";
fetch(
"https://notes.santhoshveer.com/",
)
.then((result) => result.text())
.then((html) => {
const $ = cheerio.load(html);
const title = $('meta[property="og:title"]').attr("content") ||
$("title").text() || $('meta[name="title"]').attr("content");
const description = $('meta[property="og:description"]').attr("content") ||
$('meta[name="description"]').attr("content");
console.log(title);
console.log(description);
}).catch((error) => {
console.log(error);
});
Testing
deno run --allow-net --allow-read test.ts
or
deno task test
Credits
- cheerio Npm Module - https://github.com/cheeriojs/cheerio
LICENSE
MIT