1.0.4 • Published 1 year ago

sandbox-webworker v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

sandbox-webworker

A js sandbox based on web worker

Install

$ npm install sandbox-webworker

Usage

import sandbox from 'sandbox-webworker';

async function test(expression, scope) {
  return await sandbox.evaluate(expression, scope);
}

const expression = 'a+b';
const scope = { a: 1, b: 2 };
test(expression, scope)
  .then(res => {
    console.log(res);
  })
  .catch(err => {
    console.log(err);
  });

Licence

MIT

1.0.4

1 year ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago