npm.io
1.0.1 • Published 5 years ago

hiot-wait-for

Licence
SEE LICENSE IN LICENSE
Version
1.0.1
Deps
3
Size
13 kB
Vulns
0
Weekly
0

hiot-wait-for

Promised waiting for host and TCP port to become available. It's like the node version of the wait-for-it bash script — useful for synchronizing the start-up of interdependent services, such as linked docker containers.

Install

npm install hiot-wait-for

Usage

var waitfor = require('hiot-wait-for');

return waitfor('api.github.com', 443)
  .then(() => runApp())
  .catch(err => {
    // handle error
  });

Tests

npm install
npm test