Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

coterminous-js-messageport

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coterminous-js-messageport - npm Package Compare versions

Comparing version 0.1.7 to 0.2.0

2

package.json
{
"name": "coterminous-js-messageport",
"version": "0.1.7",
"version": "0.2.0",
"description": "A transport for use with Message Ports such as WebWorkers",

@@ -5,0 +5,0 @@ "main": "npm/messageport.js",

@@ -5,3 +5,3 @@ # coterminous-js-messageport

### Useage in the Worker
<syntaxhighlight lang="js">
```
Coterminous.root({

@@ -15,6 +15,6 @@ //... your exposed api functions here

}
</syntaxhighlight>
```
### Useage in the Browser
<syntaxhighlight lang="js">
```
var worker = new SharedWorker('worker.js');

@@ -29,8 +29,9 @@ Coterminous.connect(new MessagePortTransport(worker.port)).then(function(remoteInterface)

});
</syntaxhighlight>
```
### Changing Direction
Connect - connects and gets the root object
ConnectTransport - just connects
You can swap these around to suit your needs, worker going to call the webpage? use connect. api calls in both directions? sure! Use connect in both places.
You can swap these around to suit your needs, worker going to call the webpage? use connect. api calls in both directions? sure! Use connect in both places.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc