{"id":18899565,"url":"https://github.com/imrandil/promise_javascript_reloaded_real_world_example","last_synced_at":"2026-03-02T00:30:27.423Z","repository":{"id":233110356,"uuid":"785933294","full_name":"IMRANDIL/Promise_Javascript_Reloaded_real_world_example","owner":"IMRANDIL","description":"promise javascript leet code practice question into real world like implementation","archived":false,"fork":false,"pushed_at":"2024-04-13T13:55:16.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-14T00:02:22.857Z","etag":null,"topics":["grinding","javascript","leetcode","promise","real-world-problem-solving"],"latest_commit_sha":null,"homepage":"","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/IMRANDIL.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-13T00:11:09.000Z","updated_at":"2024-04-13T08:53:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"3591d794-64be-4fe3-8a6e-f8b0f7379dfd","html_url":"https://github.com/IMRANDIL/Promise_Javascript_Reloaded_real_world_example","commit_stats":null,"previous_names":["imrandil/promise_javascript_reloaded_real_world_example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IMRANDIL%2FPromise_Javascript_Reloaded_real_world_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IMRANDIL%2FPromise_Javascript_Reloaded_real_world_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IMRANDIL%2FPromise_Javascript_Reloaded_real_world_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IMRANDIL%2FPromise_Javascript_Reloaded_real_world_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IMRANDIL","download_url":"https://codeload.github.com/IMRANDIL/Promise_Javascript_Reloaded_real_world_example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239879307,"owners_count":19712176,"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":["grinding","javascript","leetcode","promise","real-world-problem-solving"],"created_at":"2024-11-08T08:46:51.774Z","updated_at":"2026-03-02T00:30:26.982Z","avatar_url":"https://github.com/IMRANDIL.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Time Limit Function (One of the code blocks)\n\nThis function is designed to limit the execution time of another function. It wraps the provided function with a time limit, ensuring that it does not exceed a specified duration.\n\n## Usage\n\n```javascript\n/**\n * Creates a time-limited version of a function.\n * @param {Function} fn - The function to be time-limited.\n * @param {number} t - The time limit in milliseconds.\n * @returns {Function} - The time-limited function.\n */\nvar timeLimit = function(fn, t) {\n    return async function(...args) {\n        const originalFnPromise = fn(...args);\n\n        const timeoutPromise = new Promise((_, reject) =\u003e {\n            setTimeout(() =\u003e {\n                reject('Time Limit Exceeded');\n            }, t);\n        });\n\n        return Promise.race([originalFnPromise, timeoutPromise]);\n    };\n};\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimrandil%2Fpromise_javascript_reloaded_real_world_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimrandil%2Fpromise_javascript_reloaded_real_world_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimrandil%2Fpromise_javascript_reloaded_real_world_example/lists"}