vmdom
v0.0.23
Published
Lightweight browser implementation for Node's VM.
Downloads
43
Readme
vmdom
Lightweight browser implementation for Node's VM.
Installation
npm
npm install vmdom
yarn
yarn add vmdom
Usage
import {Browser} from 'vmdom'
const browser = new Browser()
const {eval, window} = browser
// Execute arbitrary JavaScript using eval
eval("window.foo = 'bar'")
console.log(window.foo) // logs "bar" to console
// When you are done make sure all timers, event handlers, etc are cleaned up
Browser.destroy(browser)