text-to-worker
TypeScript icon, indicating that this package has built-in type declarations

0.1.6 • Public • Published

text-to-worker

Moves a module into a Web Worker, automatically reflecting exported functions as asynchronous proxies.

Install

npm install --save text-to-worker

worker.js:

import { textToWorker } from "text-to-worker";

let worker = textToWorker(`
	function sum(a, b) {
        return a + b;
    }
`);

(async () => {
    const result = await worker.sum(1, 2);
    console.log(result);//prints 3;
})();

License

MIT License © Nishkal Kashyap

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.6
    0
    • latest

Version History

Package Sidebar

Install

npm i text-to-worker

Weekly Downloads

0

Version

0.1.6

License

MIT

Unpacked Size

11.1 kB

Total Files

12

Last publish

Collaborators

  • nishkal