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

accordant

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

accordant

One way shared/worker async bindings

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-95.95%
Maintainers
1
Weekly downloads
 
Created
Source

accordant

One way shared/worker async bindings to simply export bindings, as callbacks, from a Worker or a SharedWorker's port.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <script type="module">
    import { SharedWorker, Worker, proxied } from 'accordant/main';
    const sw = new SharedWorker('./shared-worker.js');
    const w = new Worker('./worker.js');
    // both workers export a `random` method
    console.log(await sw.random());
    console.log(await w.random());
    console.log(proxied(sw)); // MessagePort
    console.log(proxied(w));  // Worker
  </script>
</head>
</html>
// shared-worker.js
import exports from 'accordant/shared-worker';

exports({
  random: () => ({ SharedWorker: Math.random() }),
});
// worker.js
import exports from 'accordant/worker';

exports({
  random: () => ({ Worker: Math.random() }),
});

Keywords

FAQs

Package last updated on 09 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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