Portfinder

Find an open port or domain socket on the current machine

Library
npm
v1.0.38
898stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
42/100Fair
Development Activity0
Maintenance20
Community68
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
67/100Good
Architecture60
Code Quality68
Innovation50
Learning Curve90

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

167

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

View details
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
Updated 1 years ago
TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

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

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
JavaScript
94%
MIT

Another Redis Desktop Manager

Developer Tools · Databases

34,643

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

View details
84
Repo Health
56
Technical
67
Dependency
Built with
JavaScript94%
Updated yesterday
TypeScript
49%
MPL 2.0

Artillery

Devops · Developer Tools

9,054

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
TypeScript49%
JavaScript48%
Updated 5 days ago
Java
34%
Apache 2.0

Enso

Analytics · Data Engineering · Low Code Platforms

7,437

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
70
Repo Health
90
Technical
62
Dependency
Built with
Java34%
TypeScript27%
Scala26%
Updated 1 weeks ago
Python
64%
MIT

Flowfile

Data Engineering

341

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
Python64%
Vue19%
TypeScript16%
Updated today
TypeScript
99%
Other

NocoBase

No Code Platforms · Low Code Platforms

23,696

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
65
Dependency
Built with
TypeScript99%
Updated today

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

Search