npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

port-arranger

v0.0.4

Published

Run multiple dev servers without port conflicts

Readme

port-arranger

Run multiple dev servers without port conflicts

Quick Start · Usage Guide · Commands · How It Works

Why port-arranger?

The Problem

# Terminal 1
npm run dev  # localhost:3000

# Terminal 2
npm run dev  # Error: Port 3000 is already in use

When running multiple projects simultaneously during development, port conflicts are inevitable. You end up manually changing ports or hunting down processes to kill.

The Solution

pa run "npm run dev"  # Automatically assigns an available port

port-arranger wraps your dev server commands and automatically finds and assigns available ports. No more port conflicts, ever.

Key Features

| | Feature | Description | | ------------------ | ------------------------ | ---------------------------------------------------- | | :zap: | Auto Port Assignment | Automatically finds and assigns available ports | | :mag: | Framework Detection | Recognizes Next.js, Vite, Express, FastAPI, and more | | :clipboard: | Process Management | List, monitor, and stop running servers | | :desktop_computer: | GUI Dashboard | Visual server management with Electron-based UI |

Requirements

  • Node.js 18+

Quick Start

# Install globally
npm install -g port-arranger

# Run your dev server
pa run "npm run dev"

That's it! port-arranger handles the rest.

Usage Guide

Step 1: Run a Server

# Basic usage
pa run "npm run dev"

# With a custom name
pa run "npm run dev" --name my-frontend

# With a preferred port (falls back to available port if taken)
pa run "npm run dev" --port 3000

Step 2: Manage Servers

# List all running servers
pa list

# Stop a specific server
pa stop my-frontend

# Stop all servers
pa stop --all

Step 3: GUI Dashboard

Launch the visual dashboard for an overview of all your running servers:

pa ui

Commands

| Command | Description | Example | | ------------------------- | --------------------------------------- | ---------------------------------- | | pa run <cmd> | Run a command with auto port assignment | pa run "npm run dev" | | pa run <cmd> --name <n> | Run with a custom project name | pa run "npm run dev" --name api | | pa run <cmd> --port <p> | Run with a preferred port | pa run "npm run dev" --port 3000 | | pa list | List all running servers | pa list | | pa stop <name> | Stop a server by name | pa stop my-project | | pa stop --all | Stop all running servers | pa stop --all | | pa ui | Open the GUI dashboard | pa ui |

Supported Frameworks

| Framework | Port Injection Method | Example | | ------------------ | --------------------- | ------------------------------ | | Next.js | Environment variable | PORT=3001 npm run dev | | Vite | CLI flag | vite --port 3001 | | Express | Environment variable | PORT=3001 node server.js | | FastAPI / uvicorn | CLI flag | uvicorn main:app --port 3001 | | Python http.server | Argument | python -m http.server 3001 |

How It Works

┌─────────────────────────────────────────────────────────────┐
│  pa run "npm run dev"                                       │
└─────────────────────────────────────────────────────────────┘
                            │
                            ▼
┌─────────────────────────────────────────────────────────────┐
│  1. Parse Command                                           │
│     Detect framework pattern (Next.js, Vite, Express, etc.) │
└─────────────────────────────────────────────────────────────┘
                            │
                            ▼
┌─────────────────────────────────────────────────────────────┐
│  2. Find Available Port                                     │
│     Use detect-port to find an open port                    │
└─────────────────────────────────────────────────────────────┘
                            │
                            ▼
┌─────────────────────────────────────────────────────────────┐
│  3. Inject Port                                             │
│     Apply framework-specific injection (env, flag, arg)     │
└─────────────────────────────────────────────────────────────┘
                            │
                            ▼
┌─────────────────────────────────────────────────────────────┐
│  4. Spawn & Track Process                                   │
│     Save process info to ~/.port-arranger/state.json        │
└─────────────────────────────────────────────────────────────┘

Configuration

port-arranger stores state in ~/.port-arranger/state.json:

{
  "processes": [
    {
      "name": "my-frontend",
      "port": 3001,
      "pid": 12345,
      "command": "npm run dev",
      "cwd": "/path/to/project",
      "startedAt": "2026-02-01T10:30:00.000Z"
    }
  ]
}

Contributing

Contributions are welcome! Feel free to:

  • 🐛 Report bugs
  • 💡 Suggest features
  • 🔧 Submit pull requests

Author

Changmin (Chris) Kang