portfinder

WebJar for portfinder

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

portfinder
Last Version

Last Version

1.0.28
Release Date

Release Date

Type

Type

jar
Description

Description

portfinder
WebJar for portfinder
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/http-party/node-portfinder

Download portfinder

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/portfinder/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>portfinder</artifactId>
    <version>1.0.28</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/portfinder/
implementation 'org.webjars.npm:portfinder:1.0.28'
// https://jarcasting.com/artifacts/org.webjars.npm/portfinder/
implementation ("org.webjars.npm:portfinder:1.0.28")
'org.webjars.npm:portfinder:jar:1.0.28'
<dependency org="org.webjars.npm" name="portfinder" rev="1.0.28">
  <artifact name="portfinder" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='portfinder', version='1.0.28')
)
libraryDependencies += "org.webjars.npm" % "portfinder" % "1.0.28"
[org.webjars.npm/portfinder "1.0.28"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : async jar [2.6.2,3)
org.webjars.npm : debug jar [3.1.1,4)
org.webjars.npm : mkdirp jar [0.5.5,0.6)

Project Modules

There are no modules declared in this project.

node-portfinder Build Status

Installation

  $ [sudo] npm install portfinder

Usage

The portfinder module has a simple interface:

  var portfinder = require('portfinder');

  portfinder.getPort(function (err, port) {
    //
    // `port` is guaranteed to be a free port
    // in this scope.
    //
  });

Or with promise (if Promise are supported) :

  const portfinder = require('portfinder');

  portfinder.getPortPromise()
    .then((port) => {
        //
        // `port` is guaranteed to be a free port
        // in this scope.
        //
    })
    .catch((err) => {
        //
        // Could not get a free port, `err` contains the reason.
        //
    });

If portfinder.getPortPromise() is called on a Node version without Promise (<4), it will throw an Error unless Bluebird or any Promise pollyfill is used.

Ports search scope

By default portfinder will start searching from 8000 and scan until maximum port number (65535) is reached.

You can change this globally by setting:

portfinder.basePort = 3000;    // default: 8000
portfinder.highestPort = 3333; // default: 65535

or by passing optional options object on each invocation:

portfinder.getPort({
    port: 3000,    // minimum port
    stopPort: 3333 // maximum port
}, callback);

Run Tests

  $ npm test

Author: Charlie Robbins

Maintainer: Erik Trom

License: MIT/X11

org.webjars.npm

http ... PARTY!

Who says networking can't be fun?

Versions

Version
1.0.28
1.0.20
1.0.13
0.4.0