@lumjs/web-workers
v1.0.1
Published
A collection of functions and classes for working with Web Workers.
Readme
lum.web-workers.js
A collection of functions and classes for working with Web Workers.
It is partially based on my previous @lumjs/service-worker package, which it will replace entirely with a simpler, cleaner, yet more capable API. Unlike that package, this is written as ESM, and has no runtime dependencies.
Like the rest of my web-* packages, this is designed to be used with a
bundler to create the actual JS files that will be used in your web app.
The bundler you use is entirely up to you (I most commonly pick Webpack).
Exports
@lumjs/web-workers/common
Not meant for use on its own, this is just some common helper functions used by the various context-specific modules.
@lumjs/web-workers/service
A module for use in a Service Worker context. In addition to including
everything from the worker module, this also provides a whole bunch of
features specific to Service Workers, including:
- Create and manage caches with various caching strategies:
- Cache-First
- Cache-First-with-Refresh
- Network-First
- Push API middleware
@lumjs/web-workers/window
A module for use in a browser window context. This provides simple helpers to register, activate, and communicate with the various types of workers.
@lumjs/web-workers/worker
A module for use in both Dedicated and Shared Worker contexts. This is currently just a stub module, but will be fleshed out in the future.
Official URLs
This library can be found in two places:
Author
Timothy Totten [email protected]
