How to use the portscanner.findAPortInUse 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 DefinitelyTyped / DefinitelyTyped / types / portscanner / portscanner-tests.ts View on Github external
// three arguments
findAPortNotInUse(3000, 3010, '127.0.0.1').then(assertPort);
findAPortNotInUse(3000, 3010, findPortCallback);

// four argumentss
findAPortNotInUse(3000, 3010, '127.0.0.1', findPortCallback);

// one argument
findAPortInUse([3000, 3005, 3006]).then(assertPort);
findAPortInUse(3000).then(assertPort);

// two arguments
findAPortInUse([3000, 3005, 3006], findPortCallback);
findAPortInUse([3000, 3005, 3006], '127.0.0.1').then(assertPort);

findAPortInUse(3000, findPortCallback);
findAPortInUse(3000, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010).then(assertPort);

// three arguments
findAPortInUse(3000, 3010, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010, findPortCallback);

// four argumentss
findAPortInUse(3000, 3010, '127.0.0.1', findPortCallback);
github DefinitelyTyped / DefinitelyTyped / types / portscanner / portscanner-tests.ts View on Github external
findAPortNotInUse(3000, 3010, '127.0.0.1').then(assertPort);
findAPortNotInUse(3000, 3010, findPortCallback);

// four argumentss
findAPortNotInUse(3000, 3010, '127.0.0.1', findPortCallback);

// one argument
findAPortInUse([3000, 3005, 3006]).then(assertPort);
findAPortInUse(3000).then(assertPort);

// two arguments
findAPortInUse([3000, 3005, 3006], findPortCallback);
findAPortInUse([3000, 3005, 3006], '127.0.0.1').then(assertPort);

findAPortInUse(3000, findPortCallback);
findAPortInUse(3000, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010).then(assertPort);

// three arguments
findAPortInUse(3000, 3010, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010, findPortCallback);

// four argumentss
findAPortInUse(3000, 3010, '127.0.0.1', findPortCallback);
github DefinitelyTyped / DefinitelyTyped / types / portscanner / portscanner-tests.ts View on Github external
findAPortNotInUse(3000, 3010, findPortCallback);

// four argumentss
findAPortNotInUse(3000, 3010, '127.0.0.1', findPortCallback);

// one argument
findAPortInUse([3000, 3005, 3006]).then(assertPort);
findAPortInUse(3000).then(assertPort);

// two arguments
findAPortInUse([3000, 3005, 3006], findPortCallback);
findAPortInUse([3000, 3005, 3006], '127.0.0.1').then(assertPort);

findAPortInUse(3000, findPortCallback);
findAPortInUse(3000, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010).then(assertPort);

// three arguments
findAPortInUse(3000, 3010, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010, findPortCallback);

// four argumentss
findAPortInUse(3000, 3010, '127.0.0.1', findPortCallback);
github DefinitelyTyped / DefinitelyTyped / types / portscanner / portscanner-tests.ts View on Github external
findAPortInUse(3000).then(assertPort);

// two arguments
findAPortInUse([3000, 3005, 3006], findPortCallback);
findAPortInUse([3000, 3005, 3006], '127.0.0.1').then(assertPort);

findAPortInUse(3000, findPortCallback);
findAPortInUse(3000, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010).then(assertPort);

// three arguments
findAPortInUse(3000, 3010, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010, findPortCallback);

// four argumentss
findAPortInUse(3000, 3010, '127.0.0.1', findPortCallback);
github DefinitelyTyped / DefinitelyTyped / types / portscanner / portscanner-tests.ts View on Github external
findAPortNotInUse([3000, 3005, 3006], '127.0.0.1').then(assertPort);

findAPortNotInUse(3000, findPortCallback);
findAPortNotInUse(3000, '127.0.0.1').then(assertPort);
findAPortNotInUse(3000, 3010).then(assertPort);

// three arguments
findAPortNotInUse(3000, 3010, '127.0.0.1').then(assertPort);
findAPortNotInUse(3000, 3010, findPortCallback);

// four argumentss
findAPortNotInUse(3000, 3010, '127.0.0.1', findPortCallback);

// one argument
findAPortInUse([3000, 3005, 3006]).then(assertPort);
findAPortInUse(3000).then(assertPort);

// two arguments
findAPortInUse([3000, 3005, 3006], findPortCallback);
findAPortInUse([3000, 3005, 3006], '127.0.0.1').then(assertPort);

findAPortInUse(3000, findPortCallback);
findAPortInUse(3000, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010).then(assertPort);

// three arguments
findAPortInUse(3000, 3010, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010, findPortCallback);

// four argumentss
findAPortInUse(3000, 3010, '127.0.0.1', findPortCallback);
github DefinitelyTyped / DefinitelyTyped / types / portscanner / portscanner-tests.ts View on Github external
// one argument
findAPortInUse([3000, 3005, 3006]).then(assertPort);
findAPortInUse(3000).then(assertPort);

// two arguments
findAPortInUse([3000, 3005, 3006], findPortCallback);
findAPortInUse([3000, 3005, 3006], '127.0.0.1').then(assertPort);

findAPortInUse(3000, findPortCallback);
findAPortInUse(3000, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010).then(assertPort);

// three arguments
findAPortInUse(3000, 3010, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010, findPortCallback);

// four argumentss
findAPortInUse(3000, 3010, '127.0.0.1', findPortCallback);
github DefinitelyTyped / DefinitelyTyped / types / portscanner / portscanner-tests.ts View on Github external
findAPortNotInUse(3000, 3010, '127.0.0.1', findPortCallback);

// one argument
findAPortInUse([3000, 3005, 3006]).then(assertPort);
findAPortInUse(3000).then(assertPort);

// two arguments
findAPortInUse([3000, 3005, 3006], findPortCallback);
findAPortInUse([3000, 3005, 3006], '127.0.0.1').then(assertPort);

findAPortInUse(3000, findPortCallback);
findAPortInUse(3000, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010).then(assertPort);

// three arguments
findAPortInUse(3000, 3010, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010, findPortCallback);

// four argumentss
findAPortInUse(3000, 3010, '127.0.0.1', findPortCallback);
github DefinitelyTyped / DefinitelyTyped / types / portscanner / portscanner-tests.ts View on Github external
findAPortNotInUse(3000, '127.0.0.1').then(assertPort);
findAPortNotInUse(3000, 3010).then(assertPort);

// three arguments
findAPortNotInUse(3000, 3010, '127.0.0.1').then(assertPort);
findAPortNotInUse(3000, 3010, findPortCallback);

// four argumentss
findAPortNotInUse(3000, 3010, '127.0.0.1', findPortCallback);

// one argument
findAPortInUse([3000, 3005, 3006]).then(assertPort);
findAPortInUse(3000).then(assertPort);

// two arguments
findAPortInUse([3000, 3005, 3006], findPortCallback);
findAPortInUse([3000, 3005, 3006], '127.0.0.1').then(assertPort);

findAPortInUse(3000, findPortCallback);
findAPortInUse(3000, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010).then(assertPort);

// three arguments
findAPortInUse(3000, 3010, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010, findPortCallback);

// four argumentss
findAPortInUse(3000, 3010, '127.0.0.1', findPortCallback);
github DefinitelyTyped / DefinitelyTyped / types / portscanner / portscanner-tests.ts View on Github external
findAPortNotInUse(3000, 3010).then(assertPort);

// three arguments
findAPortNotInUse(3000, 3010, '127.0.0.1').then(assertPort);
findAPortNotInUse(3000, 3010, findPortCallback);

// four argumentss
findAPortNotInUse(3000, 3010, '127.0.0.1', findPortCallback);

// one argument
findAPortInUse([3000, 3005, 3006]).then(assertPort);
findAPortInUse(3000).then(assertPort);

// two arguments
findAPortInUse([3000, 3005, 3006], findPortCallback);
findAPortInUse([3000, 3005, 3006], '127.0.0.1').then(assertPort);

findAPortInUse(3000, findPortCallback);
findAPortInUse(3000, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010).then(assertPort);

// three arguments
findAPortInUse(3000, 3010, '127.0.0.1').then(assertPort);
findAPortInUse(3000, 3010, findPortCallback);

// four argumentss
findAPortInUse(3000, 3010, '127.0.0.1', findPortCallback);
github jaridmargolin / rc-socket / Gruntfile.js View on Github external
module.exports = function (grunt) {

  // Checks if ports 9997 to 9999 inclusive are available
  portscanner.findAPortInUse(9997, 9999, '127.0.0.1', function(error, port) {
    // Status is 'open' if currently in use or 'closed' if available
    if (!error && port) {
        throw new Error('Cannot start Services port ' + port + ' is being used.');
    }
  });

  // easy-build yo!
  easybuild.load(grunt, {
    'test:local:prehook': ['process:api:start'],
    'test:local:posthook': ['process:api:stop'],

    'test:sauce:prehook' : ['process:api:start'],
    'test:sauce:posthook' : ['process:api:stop'],

    'dev:prehook': ['process:api:start'],
    'dev:posthook': ['process:api:stop'],

portscanner

Asynchronous port scanner for Node.js

MIT
Latest version published 6 years ago

Package Health Score

71 / 100
Full package analysis