4 karma · joined May 1, 2024 (2y ago) · 3 submissions
comment 1y ago · link · parent
Now you can tap into the npm ecosystem when needed, but still use deno-first libraries as you please. If you don't like npm, then you can ignore it entirely
comment 1y ago · link · parent
All of the simple cases I've tried seem to work fine, e.g:
import { JSDOM } from "npm:jsdom";
const dom = new JSDOM(
`<!DOCTYPE html><p>Hello world <img src="https://example.com/logo.svg" /></p>`,
);
console.log(dom.window.document?.querySelector("p")?.textContent); // "Hello world"
console.log(dom.window.document?.querySelector("img")?.getAttribute("src")); // "https://example.com/logo.svg"