Skip to content
/ vmdom Public

Lightweight browser implementation for Node's VM.

Notifications You must be signed in to change notification settings

dogma-io/vmdom

Repository files navigation

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)