postmanlabs / uvm

Universal Virtual Machine for Node and Browser

Home Page:https://www.postmanlabs.com/uvm/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UVM CI codecov

Module that exposes an event emitter to send data across contexts (VM in Node.js and Web Workers in browser).

Installation

UVM can be installed using NPM or directly from the git repository within your NodeJS projects. If installing from NPM, the following command installs the module and saves in your package.json

$ npm install uvm --save

Usage

let uvm = require('uvm'),
    context;

context = uvm.spawn({
    bootCode: `
        bridge.on('loopback', function (data) {
            bridge.dispatch('loopback', data + ' World!');
        });
    `
});

context.on('loopback', function (data) {
    console.log(data); // Hello World!
});

context.dispatch('loopback', 'Hello');

About

Universal Virtual Machine for Node and Browser

https://www.postmanlabs.com/uvm/

License:Apache License 2.0


Languages

Language:JavaScript 100.0%