Hierarchy

  • JSDOM

Constructors

Properties

cookieJar: CookieJar
virtualConsole: VirtualConsole
window: DOMWindow

Methods

  • The built-in vm module of Node.js is what underpins JSDOM's script-running magic. Some advanced use cases, like pre-compiling a script and then running it multiple times, benefit from using the vm module directly with a jsdom-created Window.

    Throws

    If the JSDOM instance was created without runScripts set, or if you are using JSDOM in a web browser.

    Returns Context

  • The nodeLocation() method will find where a DOM node is within the source document, returning the parse5 location info for the node.

    Throws

    If the JSDOM was not created with includeNodeLocations

    Parameters

    Returns Location

  • The reconfigure method allows changing the window.top and url from the outside.

    Parameters

    Returns void

  • The serialize() method will return the HTML serialization of the document, including the doctype.

    Returns string

  • Parameters

    Returns Promise<JSDOM>

  • Parameters

    Returns Promise<JSDOM>