wait-for-port

wait for host/port to become available

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
wait-for-port
700.0.28 years ago9 years agoMinified + gzip package size for wait-for-port in KB

Readme

What?
Implements a single NodeJS function to wait for host/port to become available. Once available, a callback is called.
Example:
var waitForPort = require('wait-for-port');

waitForPort('my-host.com', 22, function(err) {
  if (err) throw new Error(err);
  // .. now we know that (at least for now) my-host.com is
  // listening on port 22
});

Check the specs for details and options.
Why?
This is useful e.g. when provisioning cloud stuff, e.g. call the EC2 API from Javascript to create instances, then wait for ssh to become available on all the hosts.