Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
pseudo-worker
Advanced tools
Readme
A tiny and mostly spec-compliant WebWorker polyfill, designed for browsers that don't support WebWorkers, or for browsers that don't support certain features of WebWorkers.
This runs on the main thread, so you don't get any of the multithreading benefits of WebWorkers. However, it should be "good enough" for the less-compliant browsers.
The bundle size is very small: 1kB after uglify+gzip!
npm install pseudo-worker
var PseudoWorker = require('pseudo-worker');
var worker = new PseudoWorker('script.js');
Or as a polyfill:
require('pseudo-worker/polyfill');
// now window.Worker is polyfilled in older browsers
Instead of Browserify/Webpack, you can also use it directly as a script tag:
<script src="https://unpkg.com/pseudo-worker/dist/pseudo-worker.js"></script>
Then it's available as window.PseudoWorker
. Or for the polyfill:
<script src="https://unpkg.com/pseudo-worker/dist/pseudo-worker.polyfill.js"></script>
onmessage
onerror
addEventListener
removeEventListener
postMessage
close
Note: inside the worker, you must use the self
variable instead
of the implicit global object. I.e. do this:
self.onmessage = ...
Not this:
onmessage = ...
The full list of browsers that are tested in CI are in .zuul.yml. But basically:
Node.js is not supported. Check out node-webworker instead.
First:
npm install
Then to test in Node (using an XHR shim):
npm test
Or to test manually in your browser of choice:
npm run test-local
Or to test in a browser using SauceLabs:
npm run test-browser
Or to test with coverage reports:
npm run coverage
FAQs
Tiny and mostly spec-compliant WebWorker polyfill
The npm package pseudo-worker receives a total of 1,200 weekly downloads. As such, pseudo-worker popularity was classified as popular.
We found that pseudo-worker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.