How to use the portscanner.checkPortStatusAsync function in portscanner

To help you get started, we’ve selected a few portscanner 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 kengz / spacy-nlp / src / start-io.js View on Github external
function ioStart() {
  portscanner.checkPortStatusAsync(process.env.IOPORT, '127.0.0.1')
    .then((status) => {
      if (status === 'closed') {
        // no poly socketIO server exists at port yet, start new
        return polyIO.server({
          port: process.env.IOPORT,
          clientCount: CLIENT_COUNT,
          debug: process.env['npm_config_debug']
        })
      } else {
        return Promise.resolve()
      }
    })
    .then(ioClient)
  return (global.ioPromise || Promise.resolve()).delay(10)
}

portscanner

Asynchronous port scanner for Node.js

MIT
Latest version published 6 years ago

Package Health Score

74 / 100
Full package analysis