1.1.1 • Published 5 years ago

@skypager/features-browser-vm v1.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

Browser VM

This feature makes it easy to take a chunk of javascript code as a string, and run it as if it were inside of a browser using JSDOM. You will get back the code, the result of the code, and the global context variable in a state after the script ran.

import runtime from '@skypager/node'
import '@skypager/features-browser-vm'

const browserVm = runtime.feature('browser-vm')

async function main() {
  const webpackBundledApp = await runtime.fsx.readFileAsync(runtime.resolve('build', 'app.js'))
  const { result, context } = await browserVm.runScript(webpackBundledApp)
  const { App } = context

  console.log('App Component', App)
}

main()
1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.1-alpha.1

5 years ago

1.0.1-alpha.0

5 years ago

0.4.0

5 years ago

0.3.6

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago