Gathering detailed insights and metrics for rollup-plugin-worker-factory
Gathering detailed insights and metrics for rollup-plugin-worker-factory
Gathering detailed insights and metrics for rollup-plugin-worker-factory
Gathering detailed insights and metrics for rollup-plugin-worker-factory
Bundle web workers that work in nodejs and the browser, without a separate build target.
npm install rollup-plugin-worker-factory
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
2 Stars
27 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Nov 24, 2021
Latest Version
0.5.7
Package Id
rollup-plugin-worker-factory@0.5.7
Unpacked Size
27.23 kB
Size
7.49 kB
File Count
10
NPM Version
6.14.12
Node Version
14.16.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
3
1npm i -D rollup-plugin-worker-factory
--experimental-workers
include rollup-plugin-worker-factory in your rollup plugins array for a build:
1const worker = require('rollup-plugin-worker-factory'); 2 3... 4plugins: [ 5 worker() 6] 7...
When you want to include a worker in your code prefix the file with worker!
:
1import SomeWorker from "worker!./src/some-worker.js";
Your worker should run without exporting any code and use the global self
variable to interact with the worker API. worker_threads.parentPort
for node has been slightly modified so that their API more closely matches web workers in the browser and will also be available on the global self
.
1const someDependency = require('../some-dep'); 2const whoKnows = require('who-knows'); 3 4self.addEventListener('message', function(e) { 5 const foo = someDependency(e); 6 7 self.postMessage(whoKnows(foo)); 8});
on
to addEventListener
on worker objectsoff
to removeEventListener
on worker objectspostMessage
so that the message sent is included as a value for a data
key on an object as this is how the browser works with postMessage.addEventListener
to on
on worker objectsremoveEventListener
to on
on worker objectsobjURL
propertyAn array of rollup plugins to bundle the web workers with, you will probably want:
Default: 'universal'
The type of factory to build, can be 'node', 'mock', 'browser', or 'universal'.
browser will only work in the browser
node will only work in node
mock will work everywhere but runs on the same thread
universal will work on the browser or node depending on available apis
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no SAST tool detected
Details
Reason
Found 0/27 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
26 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More