Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/postmanlabs/uvm
Universal Virtual Machine for Node and Browser
https://github.com/postmanlabs/uvm
contextify postman uvm vm
Last synced: about 1 month ago
JSON representation
Universal Virtual Machine for Node and Browser
- Host: GitHub
- URL: https://github.com/postmanlabs/uvm
- Owner: postmanlabs
- License: apache-2.0
- Created: 2016-11-27T09:20:12.000Z (almost 8 years ago)
- Default Branch: develop
- Last Pushed: 2024-09-27T22:42:33.000Z (about 2 months ago)
- Last Synced: 2024-09-29T18:21:20.845Z (about 2 months ago)
- Topics: contextify, postman, uvm, vm
- Language: JavaScript
- Homepage: https://www.postmanlabs.com/uvm/
- Size: 2.8 MB
- Stars: 41
- Watchers: 15
- Forks: 24
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.yaml
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# UVM [![CI](https://github.com/postmanlabs/uvm/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/postmanlabs/uvm/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/postmanlabs/uvm/branch/develop/graph/badge.svg)](https://codecov.io/gh/postmanlabs/uvm)
Module that exposes an event emitter to send data across contexts ([Worker threads](https://nodejs.org/api/worker_threads.html) in Node.js and [Web Workers](https://www.w3.org/TR/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````console
$ npm install uvm --save
```## Usage
```javascript
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');
```