{"id":16130168,"url":"https://github.com/lambdacasserole/shell-sleeper","last_synced_at":"2026-04-20T03:01:52.172Z","repository":{"id":62187014,"uuid":"557709884","full_name":"lambdacasserole/shell-sleeper","owner":"lambdacasserole","description":"An alternative to setTimeout and setInterval powered by the shell sleep command.","archived":false,"fork":false,"pushed_at":"2022-10-26T13:06:16.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-19T12:28:43.662Z","etag":null,"topics":["javascript","npm","setinterval","settimeout","shell","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/lambdacasserole.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}},"created_at":"2022-10-26T06:47:19.000Z","updated_at":"2024-03-17T21:05:47.000Z","dependencies_parsed_at":"2022-10-28T02:45:18.909Z","dependency_job_id":null,"html_url":"https://github.com/lambdacasserole/shell-sleeper","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lambdacasserole/shell-sleeper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdacasserole%2Fshell-sleeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdacasserole%2Fshell-sleeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdacasserole%2Fshell-sleeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdacasserole%2Fshell-sleeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lambdacasserole","download_url":"https://codeload.github.com/lambdacasserole/shell-sleeper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdacasserole%2Fshell-sleeper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32031070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"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":["javascript","npm","setinterval","settimeout","shell","typescript"],"created_at":"2024-10-09T22:14:53.637Z","updated_at":"2026-04-20T03:01:52.154Z","avatar_url":"https://github.com/lambdacasserole.png","language":"JavaScript","readme":"# shell-sleeper\nAn alternative to setTimeout and setInterval powered by the shell sleep command.\n\n## Requirements\n\n- Node.js 14 or newer\n- A system-level `sleep` utility (comes with most Linux distros) to get the most from the library\n\n## Installation\n\nExhaustion can be installed using `npm`:\n\n```sh\nnpm install --save shell-sleeper\n```\n\n## Usage\n\nUsage is very straightforward, `shell-sleeper` can serve as a drop-in replacement for `setInterval` and `setTimeout`:\n\n```js\nimport {\n    isSleepAvailable,\n    setShellInterval,\n    setShellTimeout,\n    clearShellTimeout,\n    clearShellInterval,\n    shellSleep,\n} from 'shell-sleeper';\n\n// Check if a system-level shell `sleep` utility is available.\nif (isSleepAvailable()) {\n    console.log('System-level sleep is available!');\n} else {\n    console.log('System-level sleep is not available!');\n}\n\n// setShellInterval and setShellTimeout function identically to setInterval and setTimeout.\nconst interval = setShellInterval(() =\u003e console.log(\"Will execute every 5 seconds.\"), 5000);\nconst timeout = setShellTimeout(() =\u003e console.log(\"Will execute after 5 seconds.\"), 5000);\n\n// You can clear them in just the same way too.\nclearShellInterval(interval);\nclearShellTimeout(timeout);\n\n// An extra `shellSleep` command is also included.\n(async () =\u003e {\n    await shellSleep(10000); // Will block for 10 seconds.\n})();\n```\n\nIf a system-level shell-based `sleep` utility it not available, the library will fall back to use `setInterval` and `setTimeout`.\n\n## Related Projects\n\nThis library uses the [command-exists](https://www.npmjs.com/package/command-exists) package to check for the existence of an available `sleep` command-line utility.\n\n## License\n\n[MIT](LICENSE) © [lambdacasserole](https://github.com/lambdacasserole).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdacasserole%2Fshell-sleeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flambdacasserole%2Fshell-sleeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdacasserole%2Fshell-sleeper/lists"}