{"id":17757824,"url":"https://github.com/paralleltask/dinotask","last_synced_at":"2025-09-04T05:07:11.071Z","repository":{"id":138439026,"uuid":"161376573","full_name":"ParallelTask/dinotask","owner":"ParallelTask","description":"A lightweight web-workers library for building multithreaded applications in browser.","archived":false,"fork":false,"pushed_at":"2018-12-11T19:06:41.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-13T01:12:57.119Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ParallelTask.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-11T18:28:31.000Z","updated_at":"2018-12-11T19:06:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"27927d80-4416-4726-878e-1cdf3a39c3ba","html_url":"https://github.com/ParallelTask/dinotask","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParallelTask%2Fdinotask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParallelTask%2Fdinotask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParallelTask%2Fdinotask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParallelTask%2Fdinotask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ParallelTask","download_url":"https://codeload.github.com/ParallelTask/dinotask/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246636915,"owners_count":20809514,"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":[],"created_at":"2024-10-26T17:09:02.816Z","updated_at":"2025-04-01T12:23:44.247Z","avatar_url":"https://github.com/ParallelTask.png","language":"TypeScript","readme":"# DinoTask\nDinoTask is built on top of HTML5 web-workers which provides an easy way of creating tasks that execute parallel in browser without blocking the UI thread.\n\n## Usage\n* Following HTML snippet blocks the UI Thread\n```\n\u003c!doctype html\u003e\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003ctitle\u003eUI Freeze example\u003c/title\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003cbutton id=\"normal\"\u003eNormal\u003c/button\u003e\n        \u003cbutton id=\"uifreeze\"\u003eCPU Intensive - UI Freeze\u003c/button\u003e\n    \u003c/div\u003e\n    \u003cscript\u003e\n        document.getElementById(\"normal\").addEventListener(\"click\", function () {\n            console.log(\"Normal =\u003e I take less time to execute\");\n        });\n        document.getElementById(\"uifreeze\").addEventListener(\"click\", function () {\n            console.log(\"UI Freeze =\u003e I start the loop and takes 5 to 10 seconds to execute.\");\n\n            var startTime = new Date().getTime();\n            for (var j = 0; j \u003c 1500; j++) {\n                for (var i = 0; i \u003c 10000000; i++);\n            }\n            var endTime = new Date().getTime();\n            console.log(\"UI Freeze =\u003e Total time in seconds: \" + ((endTime - startTime) / 1000));\n        });\n    \u003c/script\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\nWith the above snippet, when you right click or left click your page or any button on the page, it will not respond since it is blocking UI thread.\n\n* Following HTML snippet does not block the UI Thread\n```\n\u003c!doctype html\u003e\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003ctitle\u003eUI Freeze example\u003c/title\u003e\n        \u003cscript src=\"DinoTask.js\"\u003e\u003c/script\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003cbutton id=\"normal\"\u003eNormal\u003c/button\u003e\n        \u003cbutton id=\"uifreeze\"\u003eCPU Intensive - UI Freeze\u003c/button\u003e\n    \u003c/div\u003e\n    \u003cscript\u003e\n        document.getElementById(\"normal\").addEventListener(\"click\", function () {\n            console.log(\"Normal =\u003e I take less time to execute\");\n        });\n\n        document.getElementById(\"uifreeze\").addEventListener(\"click\", function () {\n            console.log(\"UI Responsive =\u003e I will start the loop and takes 5 to 10 seconds to execute.\");\n\n            DinoTask.create([], function () {\n                var startTime = new Date().getTime();\n                for (var j = 0; j \u003c 1000; j++) {\n                    for (var i = 0; i \u003c 10000000; i++);\n                }\n                var endTime = new Date().getTime();\n                return \"UI Responsive =\u003e Total time in seconds: \" + ((endTime - startTime) / 1000);\n\n            }).run(function (result) {\n                console.log(result);\n            }).errorHandler(function (err) {\n                console.log(err);\n            });\n        });\n    \u003c/script\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\nWith the above snippet, when you right click or left click your page or any button on the page, it will still respond since it is non-blocking UI thread. (It offloads the computation to other thread).\n\n## Download\nCDN LINK - https://cdn.jsdelivr.net/npm/dinotask@0.0.1/dinotask.js\nor you can download the file from `/dist` folder of github repository.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparalleltask%2Fdinotask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparalleltask%2Fdinotask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparalleltask%2Fdinotask/lists"}