Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • JSDOM

Index

Constructors

  • new JSDOM(html?: string | ArrayBuffer | Uint8Array | Buffer | DataView | Int8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, options?: ConstructorOptions): JSDOM
  • Parameters

    • Optional html: string | ArrayBuffer | Uint8Array | Buffer | DataView | Int8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array
    • Optional options: ConstructorOptions

    Returns JSDOM

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

    {TypeError} Note that this method will throw an exception 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

    {Error} If the JSDOM was not created with includeNodeLocations

    Parameters

    Returns null | ElementLocation

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

    Parameters

    Returns void

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

    Returns string

  • Parameters

    • html: string

    Returns DocumentFragment

  • Parameters

    Returns Promise<JSDOM>

  • Parameters

    Returns Promise<JSDOM>

Generated using TypeDoc