jsdom is a Node.js DOM implementation that functions as a headless browser emulator and virtual browser environment. It provides a pure JavaScript implementation of web standards, acting as a web standards polyfill that simulates the window and document objects within a non-browser runtime.
The project implements W3C and WHATWG specifications to provide a programmatic environment for parsing HTML and manipulating content. It serves as an HTML parser and serializer, allowing for the transformation of HTML strings into document structures and the export of those structures back into text.
The system covers a broad range of browser emulation capabilities, including the execution of in-page and external scripts, the management of HTTP cookies, and the loading of external resources via network request interception. It also includes support for CSSOM mapping, canvas API integration, and virtual console log capture.
Documents can be initialized using local files or remote URLs.