Portfinder

Find an open port or domain socket on the current machine

Library
npm
v1.0.38
899 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
42 /100 Fair
Development Activity 0
Maintenance 20
Community 68
Maturity 60
Momentum 20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
67 /100 Good
Architecture 60
Code Quality 68
Innovation 50
Learning Curve 90

Portfinder is a small Node.js utility that scans a configurable port range and returns the first free TCP port (or domain socket) it finds, guaranteed available at the moment it’s returned. It solves the common problem of hardcoding a port number in dev servers, test suites, or local tooling, where a hardcoded port can already be in use by another process.

The library exposes both callback (getPort(callback)) and promise-based (getPortPromise()) APIs, with global (setBasePort/setHighestPort) or per-call options to control the scanned range (default: 8000 to 65535). It has no heavyweight dependencies beyond async and debug, making it a lightweight addition to build tools and test harnesses.

What You Get

  • Callback-based getPort(callback) API for finding a single free port
  • Promise-based getPortPromise() API for use with async/await
  • Global range configuration via setBasePort/setHighestPort, or per-call port/stopPort options
  • Support for finding a free domain socket in addition to TCP ports
  • Zero native dependencies — pure JavaScript with async and debug as its only runtime deps

Common Use Cases

  • Dev servers and build tools (webpack-dev-server, browser-sync style tooling) picking an available port instead of hardcoding one
  • Test suites and CI pipelines that need a guaranteed-free port per test run to avoid port collisions
  • CLI tools that spin up a local server and need to avoid conflicting with a port already in use
  • Multi-instance local development setups where several services need distinct, non-conflicting ports

Under The Hood

Architecture - The entire implementation lives in a single file, lib/portfinder.js, which sequentially attempts to bind a Node net.Server (or Unix socket path) to increasing port numbers, closing each successful bind immediately and returning that port to the caller; the async dependency drives the sequential try-next-port control flow. Tech Stack - Pure JavaScript (100% of the codebase) with only async (control-flow helper) and debug (logging) as runtime dependencies, tested with Jest, and shipping hand-written .d.ts type declarations rather than being authored in TypeScript. Code Quality - The test/ directory covers the callback API, promise API, base/highest port configuration, and socket-path lookup; the codebase is small and stable enough that it has seen minimal recent commits, reflected in the low development-activity health score despite being a mature, widely-depended-upon package. API Design - The library exposes exactly two entry points (getPort/getPortPromise) plus two setters (setBasePort/setHighestPort), giving a near-zero learning curve; the callback-first design (with a promise variant added later) reflects its 2012 origins but both styles remain fully supported.

Used by 7 apps in this directory

TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

166

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
31
Repo Health
70
Technical
64
Dependency
Built with
TypeScript 76%
MDX 18%
Updated 1 years ago
TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,623

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
71
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 3 weeks ago
JavaScript
94%
MIT

Another Redis Desktop Manager

Databases · Developer Tools

34,787

Fast, stable Redis GUI with cluster, SSH, and massive key support

View details
81
Repo Health
56
Technical
67
Dependency
Built with
JavaScript 94%
Updated 1 months ago
TypeScript
49%
MPL 2.0

Artillery

Developer Tools · Devops

9,083

Cloud-scale load testing and functional testing for APIs, WebSockets, gRPC, and headless browsers, distributed across AWS Lambda or Fargate with zero infrastructure to manage.

View details
89
Repo Health
73
Technical
68
Dependency
Built with
TypeScript 49%
JavaScript 48%
Updated 1 weeks ago
Java
34%
Apache 2.0

Enso

Analytics · Data Engineering · Low Code Platforms

7,441

A visual and textual programming platform for data prep and analysis where the node graph and the underlying Enso code are always perfectly in sync, built by an Alteryx co-founder on a GraalVM engine.

View details
59
Repo Health
90
Technical
61
Dependency
Built with
Java 34%
TypeScript 27%
Scala 26%
Updated 1 months ago
Python
65%
MIT

Flowfile

Data Engineering

363

Visual ETL that compiles to Polars — build pipelines on a canvas, export as standalone Python, and run anywhere without platform lock-in.

View details
83
Repo Health
81
Technical
66
Dependency
Built with
Python 65%
Vue 17%
TypeScript 17%
Updated 6 days ago
TypeScript
99%
Other

NocoBase

Low Code Platforms · No Code Platforms

24,377

Open-source AI + no-code platform that lets coding agents and people collaborate to build business systems fast on proven infrastructure.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
TypeScript 99%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers