import net from "node:net";
export function isPortAvailable(host, port) {
    return new Promise((resolve, _reject) => {
        const socket = new net.Socket();
        socket.connect(port, host);
        socket.on("connect", () => {
            socket.destroy();
            resolve(false);
        });
        socket.on("error", (_err) => {
            socket.destroy();
            resolve(true);
        });
    });
}
//# sourceMappingURL=ports.js.map