Socket
Socket
Sign inDemoInstall

worktank

Package Overview
Dependencies
2
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.2.0 to 2.3.0

7

dist/worker/frontend.js
/* IMPORT */
import WorkerShim from 'web-worker';
import WorkerShim from 'webworker-shim';
import WorkerBackend from './backend_compiled.js';

@@ -8,5 +8,4 @@ /* MAIN */

constructor(methods, name, listener) {
const Worker = globalThis.Worker || WorkerShim; // Ensuring Electron is supported
const code = `data:text/javascript;charset=utf-8,${encodeURIComponent(WorkerBackend.replace('/*! METHODS_PLACEHOLDER !*/', `\n\n\n${methods}`))}`; //TODO: Use Blobs instead, maybe
this.worker = new Worker(code, { name, type: 'module' });
const code = `data:text/javascript;charset=utf-8,${encodeURIComponent(WorkerBackend.replace('/*! METHODS_PLACEHOLDER !*/', `\n\n\n${methods}`))}`;
this.worker = new WorkerShim(code, { name, type: 'module' });
this.listen(listener);

@@ -13,0 +12,0 @@ }

@@ -5,3 +5,3 @@ {

"description": "A simple isomorphic library for executing functions inside WebWorkers or Node Threads pools.",
"version": "2.2.0",
"version": "2.3.0",
"type": "module",

@@ -33,3 +33,3 @@ "main": "dist/index.js",

"promise-make-naked": "^2.0.0",
"web-worker": "1.2.0"
"webworker-shim": "^1.0.0"
},

@@ -36,0 +36,0 @@ "devDependencies": {

@@ -74,3 +74,5 @@ # WorkTank

- **WebPack**: [worktank-loader](https://github.com/fabiospampinato/worktank-loader).
- **Esbuild**: //TODO
- **Vite**: //TODO
- **WebPack**: [worktank-loader](https://github.com/fabiospampinato/worktank-loader), it only works with v1.x.x.

@@ -77,0 +79,0 @@ Read their documentation to learn how to use them, but TL;DR: it's mostly just a matter of adding a couple of lines of configuration for your bundlers.

/* IMPORT */
import WorkerShim from 'web-worker';
import WorkerShim from 'webworker-shim';
import WorkerBackend from './backend_compiled';

@@ -20,8 +20,6 @@ import type {Message} from '../types';

const Worker = globalThis.Worker || WorkerShim; // Ensuring Electron is supported
const code = `data:text/javascript;charset=utf-8,${encodeURIComponent ( WorkerBackend.replace ( '/*! METHODS_PLACEHOLDER !*/', `\n\n\n${methods}` ) )}`;
const code = `data:text/javascript;charset=utf-8,${encodeURIComponent ( WorkerBackend.replace ( '/*! METHODS_PLACEHOLDER !*/', `\n\n\n${methods}` ) )}`; //TODO: Use Blobs instead, maybe
this.worker = new WorkerShim ( code, { name, type: 'module' } );
this.worker = new Worker ( code, { name, type: 'module' } );
this.listen ( listener );

@@ -28,0 +26,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc