How to use is-port-reachable - 1 common examples

To help you get started, we’ve selected a few is-port-reachable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zeit / now / packages / now-static-build / src / index.ts View on Github external
async function checkForPort(
  port: number | undefined,
  timeout: number
): Promise {
  const start =;
  while (!(await isPortReachable(port))) {
    if ( - start > timeout) {
      throw new Error(`Detecting port ${port} timed out after ${ms(timeout)}`);
    await sleep(100);


Check if a local or remote port is reachable

Latest version published 2 years ago

Package Health Score

74 / 100
Full package analysis

Popular is-port-reachable functions