New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

web-worker-components

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

web-worker-components

Custom elements for running Web Workers.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

Web Worker Components

Custom elements for running Web Workers.

See Developer.md for implementation decisions and details.

See Roadmap.md for upcoming features.

Demo

The demo directory contains demo pages for various example usages. Run npm run demo to launch the demo site at localhost:5000.

But before the demo site is usable, the project distribution files have to be built first.

Install & Use

Download the release bundle or build it from the source, then include the needed files in your project.

Simple example

parent.html

<script src="web-worker-components.js"></script>
<web-worker id="worker" src="worker.js"></web-worker>
<script>
worker.onmessage = (e) => {
  console.log("Message received from worker", e.data);
};
worker.postMessage("Hello World!");
</script>

worker.js

onmessage = function(e) {
  console.log('Message received from main script', e.data);
  postMessage(e.data);
}

Building

Run npm install && npm run build to build the distribution files to dist directory.

Dependencies

This library requires browser support for Custom Elements.

It also requires native-shim available here to allow use of Custom Elements in transpiled ES5 code.

The polyfills are already bundled in web-worker-components.js. Use web-worker-components-lite.js if the polyfills are provided separately.

Versions

This project follows Semantic Versioning. See History.md for release changes.

FAQs

Package last updated on 01 Jul 2017

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