Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/easyts/net/ip.ts>splitHostPort

js library written with ts, use select and chan like golang in js.
Latest
function splitHostPort
import { splitHostPort } from "https://deno.land/x/easyts@0.1.3/net/ip.ts";

SplitHostPort splits a network address of the form "host:port", "host%zone:port", "[host]:port" or "[host%zone]:port" into host or host%zone and port.

A literal IPv6 address in hostport must be enclosed in square brackets, as in "[::1]:80", "[::1%lo0]:80".

Parameters

hostport: string

Returns

[string, string]