1.0.8 • Published 4 years ago

async-portsscanner v1.0.8

Weekly downloads
-
License
WTFPL
Repository
github
Last release
4 years ago

portscanner

Zero dependence

require

node >= 14

Install

npm install async-portscanner 

Usage

A brief example:

// using in ES module
import {findAPortInUse, findAPortNotInUse} from 'async-portsscanner';

findAPortInUse({startPort: 2999, endPort: 3002, host: '127.0.0.1'})
  .then(data=>{
    const {error, port} = data;
    console.log(error, port);
  });

findAPortNotInUse({portList: [2999, 3000, 3001]})
  .then(data=>{
    const {error, port} = data;
    console.log(error, port);
  })
// using in commonJS
import('async-portsscanner')
  .then(data=>{
    const {findAPortInUse, findAPortNotInUse} = data;
    findAPortInUse({startPort: 2999, endPort: 3002, host: '127.0.0.1'})
      .then(data=>{
        const {error, port} = data;
        console.log(error, port);
      });

    findAPortNotInUse({portList: [2999, 3000, 3001]})
      .then(data=>{
        const {error, port} = data;
        console.log(error, port);
      })
  })

Test

npm test
1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago