Get Server Address
JSON →get-server-address is a concise and focused utility for Node.js environments that provides a standardized way to retrieve the listening address of an `http.Server` instance. It abstracts away the intricacies of directly interacting with `server.address()`, which can return different types (string for Unix sockets, or an object for `AddressInfo` with IPv4/IPv6 details). The package aims to return a human-readable URL string, correctly handling IPv6 addresses by wrapping them in brackets (e.g., `http://[::1]:3000`). Currently at version 1.0.1, it maintains a stable API, with releases likely occurring only for critical bug fixes or compatibility updates with new Node.js versions. It differentiates itself by offering a simple, consistent API for a common server-side task, focusing solely on the address retrieval rather than server creation or management.
Traffic · last 30 days ↑33% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇩🇪 Germany