{"id":13394346,"url":"https://github.com/developit/workerize","last_synced_at":"2025-05-14T04:10:25.677Z","repository":{"id":43025963,"uuid":"116875602","full_name":"developit/workerize","owner":"developit","description":"🏗️ Run a module in a Web Worker.","archived":false,"fork":false,"pushed_at":"2021-03-04T23:04:53.000Z","size":64,"stargazers_count":4381,"open_issues_count":19,"forks_count":91,"subscribers_count":50,"default_branch":"master","last_synced_at":"2025-05-13T22:26:56.643Z","etag":null,"topics":["threading","web-worker","web-workers"],"latest_commit_sha":null,"homepage":"https://github.com/developit/workerize-loader","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-09T21:59:27.000Z","updated_at":"2025-05-09T15:15:12.000Z","dependencies_parsed_at":"2022-08-12T10:11:05.815Z","dependency_job_id":null,"html_url":"https://github.com/developit/workerize","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fworkerize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fworkerize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fworkerize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fworkerize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developit","download_url":"https://codeload.github.com/developit/workerize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254070122,"owners_count":22009560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["threading","web-worker","web-workers"],"created_at":"2024-07-30T17:01:16.612Z","updated_at":"2025-05-14T04:10:20.658Z","avatar_url":"https://github.com/developit.png","language":"JavaScript","readme":"\u003ch2 align=\"center\"\u003e\n  💖 Using Webpack? You want \u003ca href=\"https://github.com/developit/workerize-loader\"\u003eworkerize-loader ➡️\u003c/a\u003e\n\u003c/h2\u003e\n\n\u003cimg src=\"https://i.imgur.com/MBlHoDp.jpg\" width=\"1358\" alt=\"workerize\"\u003e\n\n# Workerize [![npm](https://img.shields.io/npm/v/workerize.svg?style=flat)](https://www.npmjs.org/package/workerize) [![travis](https://travis-ci.org/developit/workerize.svg?branch=master)](https://travis-ci.org/developit/workerize)\n\n\u003e Moves a module into a Web Worker, automatically reflecting exported functions as asynchronous proxies.\n\n- Bundles a tiny, purpose-built RPC implementation into your app\n- If exported module methods are already async, signature is unchanged\n- Supports synchronous and asynchronous worker functions\n- Works beautifully with async/await\n- Just **800 bytes** of gzipped ES3\n\n\n## Install\n\n```sh\nnpm install --save workerize\n```\n\n\n### Usage\n\nPass either a function or a string containing code.\n\n**worker.js**:\n\n```js\nlet worker = workerize(`\n\texport function add(a, b) {\n\t\t// block for half a second to demonstrate asynchronicity\n\t\tlet start = Date.now();\n\t\twhile (Date.now()-start \u003c 500);\n\t\treturn a + b;\n\t}\n`);\n\n(async () =\u003e {\n\tconsole.log('3 + 9 = ', await worker.add(3, 9));\n\tconsole.log('1 + 2 = ', await worker.add(1, 2));\n})();\n```\n\n### License\n\n[MIT License](https://oss.ninja/mit/developit/) © [Jason Miller](https://jasonformat.com)\n","funding_links":[],"categories":["JavaScript","Web Worker","Framework agnostic packages"],"sub_categories":["Runner","Docker Custom Builds","Web workers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopit%2Fworkerize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopit%2Fworkerize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopit%2Fworkerize/lists"}