Stop Guessing localhost Ports with portmap and TypeScript
AI coding agents are very good at remembering common conventions. That is also why they can be very confident and completely wrong about localhost:3000 . One project may expose a Vite frontend on port 5173. Another may run an API on 8080. A Docker mapping can make the host port different from the container port, while an .env.local file may still point to a service that is not running today. The…
A new CLI tool called portmap aims to help developers avoid confusion when working with localhost ports in local development environments. The tool combines declared configuration, OS listener data, and environment references into a .portmap.json report for analysis. It can identify issues like stale URLs that cause problems like CORS errors, authentication failures, or broken API clients.
The tutorial demonstrates building portmap from source, running a static scan to inspect findings, and understanding where the tool stops making assumptions. Prerequisites include Node.js 20+, npm, Git, and a dev machine with listener support. The tool is MIT-licensed and currently at version 0.1.0, with no GitHub release available.
Portmap can identify issues like declared ports without listeners, listeners without declared configuration, Docker host/container port mismatches, and unresolved environment URLs. This provides concrete evidence for developers to address before changing application code.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.