Skip to content

Nishkalkashyap/text-to-worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Run functions directly in a webworker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published