nwhit
Joined 2 years ago
Karma
4
Submissions
3
Member since
May 1
Joined 2 years ago
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
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"