{"id":34758087,"url":"https://github.com/sourcepirate/worker.js","last_synced_at":"2026-05-27T14:32:50.234Z","repository":{"id":79728971,"uuid":"43049347","full_name":"sourcepirate/worker.js","owner":"sourcepirate","description":null,"archived":false,"fork":false,"pushed_at":"2015-09-24T06:40:32.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-14T07:20:18.485Z","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/sourcepirate.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":"2015-09-24T06:35:49.000Z","updated_at":"2024-04-14T07:20:18.485Z","dependencies_parsed_at":"2023-02-28T02:46:05.435Z","dependency_job_id":null,"html_url":"https://github.com/sourcepirate/worker.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sourcepirate/worker.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcepirate%2Fworker.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcepirate%2Fworker.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcepirate%2Fworker.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcepirate%2Fworker.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcepirate","download_url":"https://codeload.github.com/sourcepirate/worker.js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcepirate%2Fworker.js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33570992,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"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":"2025-12-25T05:48:02.918Z","updated_at":"2026-05-27T14:32:50.230Z","avatar_url":"https://github.com/sourcepirate.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"##Thread.js\n\nTheading Implementation using HTML5 WorkerAPI.\n\n\n##Installation\n\n```\n#through npm\n\ngit clone https://github.com/plasmashadow/worker.js\n\ncd worker.js/\n\nnpm install\n\n#on browser\n\n\u003cscript src=\"thread.js\"\u003e\u003c/script\u003e\n\n```\n\n##Usage\n\n\n###Creating Threads\n\n```javascript\n\nvar thread = new Thread();\n\nvar childid = thread.addTask(function(a){\n  for(var i=0; i\u003c 100; i++){\n    cosole.log(a);\n  }\n  }, \"sathya\");\n\n\nvar childid2 = thread.addTask(function(a){\n    for(var i=0; i\u003c 100; i++){\n      cosole.log(a);\n    }\n    }, \"adhi\");\n\nthread.start();\n\n```\n\n###Event handling\n\nThread Events can be managed by their respective events.\n\n```javascript\nvar thread = new Thread();\n\nthread.once('message', function(message){\n  console.log(message);\n})\n\nthread.once('close', function(){\n  console.log(\"thread is ending\");\n})\n\nthread.once('error', function(error){\n  console.log(error);\n})\n\n```\n\n###Posting Message to Child Threads\n\nPosting message can to the childs can be done with there childids.\n\n```javascript\n\nthread.message(childid, \"please work fast\");\n\n\n```\n\n\n##License  \nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcepirate%2Fworker.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcepirate%2Fworker.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcepirate%2Fworker.js/lists"}