Socket
Socket
Sign inDemoInstall

workerboxjs

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workerboxjs - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

2

lib/index.js

@@ -43,3 +43,3 @@ import createCallbackStore from './createCallbackStore.js';

if (options.appendVersion) {
scriptUrl = scriptUrl + '/v4.0.1/';
scriptUrl = scriptUrl + '/v4.0.2/';
}

@@ -46,0 +46,0 @@

{
"name": "workerboxjs",
"version": "4.0.1",
"version": "4.0.2",
"type": "module",

@@ -38,3 +38,2 @@ "description": "A secure sandbox to execute untrusted user JavaScript, in a web browser, without any risk to your own domain/site/page.",

"@markwylde/ftp-deploy": "^2.0.1",
"basictap": "^3.4.3",
"chokidar": "^3.5.3",

@@ -45,9 +44,5 @@ "debounce": "^1.2.1",

"minify": "^9.1.0",
"process": "^0.11.10",
"puppeteer": "^19.2.2",
"servatron": "^2.4.2"
},
"dependencies": {
"promise-deferred": "^2.0.3"
}
}

@@ -18,2 +18,3 @@ # WorkerBox

// Note each `workerbox` instance has it's own sandbox
const { run, destroy } = await createWorkerBox('https://sandbox.workerbox.net/');

@@ -26,3 +27,11 @@

// You can save state between running code
// But this will not save between different workerbox instances.
await run(`
globalThis.sharedVariable = 123
`);
const result = await run(`
// globalThis.sharedVariable === 123;
async function sayHello (who) {

@@ -37,5 +46,34 @@ return 'Hello ' + who + '. ' + await getMessage();

destroy() // Destroys the worker box, terminating any running workers
// Destroys the workerbox, terminating the webworker
destroy()
```
## Development
If you want to check this project out locally, you can do the following:
### Run your own local server
```
git clone https://github.com/markwylde/workerbox.git
cd workerbox
npm install
npm run start
```
Visit https://0.0.0.0:8002 in your browser and make sure to ignore the TLS security errors.
Web workers will only work in secure contexts, so we need to do this locally.
### Run the demo project
```
cd demo
npm install
npm run start
```
### Run the tests
```
npm run test
```
Visit https://0.0.0.0:8000 in your browser.
## How does it work?

@@ -42,0 +80,0 @@ An iframe is inserted into the page from a completely separate domain.

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc