jsdom-web

1.1.0 • Public • Published

jsdom-web

3,6kb web implementation of some jsdom features, to give you the same API

NOTE: Only most important features are implemented. The goal of this is to provide a lightweight implementation of the core jsdom API for the web, without implementing an own serializer and instead using the native document.createElement() and document.createTextNode() methods.

Usage

Put the code from this site at the top of your code

// JSDOM is already available in the global scope
const dom = new JSDOM('<div id="my-div">Hello World</div>');
const div = dom.window.document.getElementById('my-div');
console.log(div.textContent); // 'Hello World'

Readme

Keywords

Package Sidebar

Install

npm i jsdom-web

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

6.43 kB

Total Files

4

Last publish

Collaborators

  • greencoder001