{"id":18043292,"url":"https://github.com/jochemstoel/nodejs-system-sleep","last_synced_at":"2025-08-21T10:31:01.506Z","repository":{"id":57376251,"uuid":"45202484","full_name":"jochemstoel/nodejs-system-sleep","owner":"jochemstoel","description":"Sleep function for Node.js All platforms.","archived":false,"fork":false,"pushed_at":"2020-09-28T07:00:06.000Z","size":547,"stargazers_count":51,"open_issues_count":7,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-07T12:27:27.877Z","etag":null,"topics":["linux","nodejs","osx","sleep","system","windows"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/system-sleep","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jochemstoel.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":"2015-10-29T18:24:31.000Z","updated_at":"2024-04-05T01:41:04.000Z","dependencies_parsed_at":"2022-09-05T19:12:21.545Z","dependency_job_id":null,"html_url":"https://github.com/jochemstoel/nodejs-system-sleep","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/jochemstoel%2Fnodejs-system-sleep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochemstoel%2Fnodejs-system-sleep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochemstoel%2Fnodejs-system-sleep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochemstoel%2Fnodejs-system-sleep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jochemstoel","download_url":"https://codeload.github.com/jochemstoel/nodejs-system-sleep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230507051,"owners_count":18236944,"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":["linux","nodejs","osx","sleep","system","windows"],"created_at":"2024-10-30T17:08:00.791Z","updated_at":"2024-12-19T22:07:57.680Z","avatar_url":"https://github.com/jochemstoel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js Sleep()\nfor those who need Sleep() just like me.\n\n![Sleeping Beauty](https://68.media.tumblr.com/02cbcb04de3577bc89ef3c98fdbc94ab/tumblr_oknt65m0Iv1ru9jhqo1_1280.jpg)\n\n*31 january 2017 | UPDATE: NO LONGER REQUIRES CHILD PROCESS, using deasync instead.*\n\n```\n @package system-sleep\n @version 1.2\n @author Jochem Stoel (http://jochemstoel.github.io)\n @license don't involve me\n ```\n\n* will make the system wait xxx milliseconds.\n* can be used to delay script execution.\n* is often used to relax the system in between resource intensive tasks.\n* works on every platform x86 + x64 Windows / Linux / OSX\n\n\n\n* Existing sleep() solutions use a blocking while loop which uses 100% CPU. This is incredibly stupid.\n* Also, many sleep() solutions are only for Windows or only for Linux.\n\n### Install using NPM\n```bash\nnpm install system-sleep\n```\n### Use\n```javascript\nvar sleep = require('system-sleep');\nsleep(5000); // 5 seconds\n```\n### Test\nPrints \u003ci\u003e\u003ca\u003evariable y\u003c/a\u003e\u003c/i\u003e to the console every 1 second during 10 seconds.\n```javascript\nvar sleep = require('system-sleep');\nfor (y = 0; y \u003c 10; y++) {\n\tconsole.log(y);\n\tsleep(1000);\n}\n```\n\n\u003cimg alt=\"Jochem Stoel\" src=\"http://33.media.tumblr.com/avatar_048a728a1488_128.png\" style=\"float: left;\"\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjochemstoel%2Fnodejs-system-sleep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjochemstoel%2Fnodejs-system-sleep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjochemstoel%2Fnodejs-system-sleep/lists"}