Hacker News new | ask | show | jobs
by Jarred 1060 days ago
The closest thing we have builtin is HTMLRewriter, which is more of a tool for transforming HTML than for traversing.

I have looked a bunch of times at how hard it’d be to import the DOM APIs from WebKit/Safari and would really love to if it didn’t also mean pulling in most of a web browser

I think happy-dom is good for DOM-like testing though.

https://bun.sh/docs/test/dom

1 comments

Thanks HTMLRewriter actually fits my use case perfectly. I don't need canvas and complicated stuff like that. Just the ability to parse some html and strip out certain things.