{
  "id": 16322634,
  "title": "Stop Guessing localhost Ports with portmap and TypeScript",
  "url": "https://urgent.news/2026/10/24/stop-guessing-localhost-ports-with-portmap-and-typescript",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-24T12:31:02.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/paladini/stop-guessing-localhost-ports-with-portmap-and-typescript-4876"
  },
  "original_language": "en",
  "account": "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.",
  "summary": "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…",
  "key_points": [
    "portmap CLI tool addresses localhost port confusion in dev environments",
    "Combines config, OS data, and env references into .portmap.json report",
    "Identifies issues like stale URLs, port-listener mismatches, and unresolved env URLs"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}