Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 799 Bytes

README.md

File metadata and controls

41 lines (26 loc) · 799 Bytes

vmdom NPM Coverage

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)