{"id":22339779,"url":"https://github.com/scriptollc/w8r","last_synced_at":"2025-08-26T06:38:13.368Z","repository":{"id":86545840,"uuid":"65318523","full_name":"scriptoLLC/w8r","owner":"scriptoLLC","description":"✋ Wait for it...","archived":false,"fork":false,"pushed_at":"2018-10-08T17:32:45.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-09T18:52:15.947Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scriptoLLC.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,"zenodo":null}},"created_at":"2016-08-09T18:27:02.000Z","updated_at":"2018-10-11T21:23:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"b20d34dc-de54-4472-ade7-a8c19ed60a0b","html_url":"https://github.com/scriptoLLC/w8r","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/scriptoLLC/w8r","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptoLLC%2Fw8r","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptoLLC%2Fw8r/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptoLLC%2Fw8r/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptoLLC%2Fw8r/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scriptoLLC","download_url":"https://codeload.github.com/scriptoLLC/w8r/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptoLLC%2Fw8r/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272186211,"owners_count":24888333,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"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":"2024-12-04T07:09:22.639Z","updated_at":"2025-08-26T06:38:13.347Z","avatar_url":"https://github.com/scriptoLLC.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# w8r\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/scriptoLLC/w8r.svg)](https://greenkeeper.io/)\n[![Build Status](https://travis-ci.org/scriptoLLC/w8r.svg?branch=master)](https://travis-ci.org/scriptoLLC/w8r)\nPoll to see if a service is running, and once it is, fork a new node process\n\n## Huh?\n`(net|http).createServer()#listen` is async. Sometimes you want to do something\nbut only after the a server has started. You can just hope it starts in time,\nor you can use this.\n\nAlso useful for docker-compose -- if you have dependent containers, docker will\nwait for the container to be ready, but it doesn't know if the service is\nready yet.  This makes sure your app won't start until the service it depends\non is available.\n\n## Usage\n\n`npm install --save w8r`\n\n```\nconst w8r = require('w8r')\nconst serverlist = [{host: 'redis', port: 6379}, '/var/run/mysql']\nw8r(50, serverlist, 'start-server.js', (err, child) =\u003e {\n  // both services are up and running!\n  // and child is your child process you started!\n})\n```\n\n## API\n\n* `w8r(checkInterval:number, serverList:array, procfile:string, procargs?:array(string), procopts?:object, cb:function)`\nSpawn a `net` client to check to see if the server at the provided host:port is\navailable every `checkInterval` ms and then fork a new node process.\n\n* `checkInterval:number` - amount of delay, in ms, before trying again\n* `profile:string` - the path to the entry point for the child process\n* `procargs:array(string)` (optional) - arguments to your command\n* `procopts:object` (optional) - options for the [`child_process.fork`](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options) command\n\nThe `serverList` array can contain two separate object types:\n* paths to unix domain sockets (e.g.: `/var/run/mysql`)\n* objects containing a `port` and `host` key (e.g.: `{port: 6379, host: 'redis'}`)\n\n## Licence\nCopyright © 2016 Scripto, LLC. Apache-2.0 Licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscriptollc%2Fw8r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscriptollc%2Fw8r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscriptollc%2Fw8r/lists"}