{"id":23053681,"url":"https://github.com/component/worker","last_synced_at":"2025-08-15T04:30:56.269Z","repository":{"id":8132734,"uuid":"9550360","full_name":"component/worker","owner":"component","description":"Nicer web worker API","archived":false,"fork":false,"pushed_at":"2013-08-21T17:31:06.000Z","size":65,"stargazers_count":20,"open_issues_count":0,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-03T07:05:54.363Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/component.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","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":"2013-04-19T17:08:52.000Z","updated_at":"2020-03-03T23:15:30.000Z","dependencies_parsed_at":"2022-08-23T22:40:46.207Z","dependency_job_id":null,"html_url":"https://github.com/component/worker","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/component/worker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fworker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fworker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fworker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fworker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/component","download_url":"https://codeload.github.com/component/worker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fworker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270523882,"owners_count":24600186,"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","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-12-16T00:19:08.484Z","updated_at":"2025-08-15T04:30:56.039Z","avatar_url":"https://github.com/component.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# worker\n\n  Web worker API wrapper.\n\n## Installation\n\n    $ component install component/worker\n\n## API\n\n### Worker(script)\n\n  Initialize a worker with the given `script`.\n\n### Worker#send(msg)\n\n  Send a message to the worker.\n\n```js\nvar upper = new Worker('uppercase.js');\n\nupper.on('message', function(msg){\n  console.log(msg.string);\n});\n\nupper.send({ string: 'hello' });\nupper.send({ string: 'world' });\n```\n\n### Worker#send(msg, callback[, transferables])\n\n  Send a request message to the worker with the given `callback`. When\n  using the request/response paradigm you should pass the `e.data.id` property\n  back with your response so that the correct callback may be invoked:\n\nworker:\n\n```js\nonmessage = function(e) {\n  setTimeout(function(){\n    postMessage({ id: e.data.id, string: e.data.string.toUpperCase() });\n  }, 500);\n};\n```\n\nclient:\n\n```js\nupper.send({ string: 'hello' }, function(msg){\n  console.log(msg.string);\n});\n```\n\n### Worker#close()\n\n  Terminate the worker.\n\n## License\n\n  MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomponent%2Fworker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomponent%2Fworker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomponent%2Fworker/lists"}