Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

find-open-port

testiumjs3.8kBSD-3-Clause2.0.3

Returns a promise for an open port on localhost

find, open, port

readme

nlm-chat nlm-github nlm-node nlm-version

Find an Open Port Build Status

Install

npm install --save find-open-port

Usage

const findPort = require('find-open-port');

findPort().then(port => {
  console.log(`You may now start listening on %d.${port}`);
});

findPort.isAvailable(80).then(available => {
  console.log(`Port 80 is ${available ? 'available' : 'not available'}`);
});

changelog

v2.0.3 (2021-03-26)

🏡 Internal

2.0.2 - 2021-02-17

2.0.1 - 2020-07-20

2.0.0 - 2020-03-26

Breaking Changes

  • drop node 8 / 6 / 4 & 0.1x support
  • findPort() is no longer based on Bluebird

See: a1c31eb

Commits

  • chore: drop node 8 and below support & remove bluebird & upgrade packages - @aaarichter #5
    • a1c31eb refactor: drop node 8 and below support & remove bluebird & upgrade packages

1.0.2

  • Use default pkg.json#files style - @jkrems #3
    • eeb704d chore: Use default pkg.json#files style

1.0.1

  • Apply latest nlm generator - @i-tier-bot #2
    • 7cc3787 chore: Apply latest nlm generator
    • 2a6dfa2 refactor: Follow common project structure
    • 77291b2 chore: Use proper author field
  • 22fb9c2 chore: Add build on node 0.12
  • c8dd2a2 docs: Update README.md

1.0.0

  • Initial version pulled out of testium itself