global-undom
v0.1.1
Published
Run browser-specific code in node using undom
Downloads
23
Readme
global-undom
Run browser-specific code in node using
undom
This module shims the global document
object in non-browser environments. Excludes the shim if required by a browser environment (using the browser
field in package.json
). This allows for easy testing without something heavy-weight like jsdom
.
Installation
$ npm install global-undom
Example
const document = require('global-undom')
// e.g. document.createTextNode()