Have ideas to improve npm?Join in the discussion! »

    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

    Install

    npm i text-to-worker

    DownloadsWeekly Downloads

    3

    Version

    0.1.6

    License

    MIT

    Unpacked Size

    11.1 kB

    Total Files

    12

    Last publish

    Collaborators

    • avatar