UNPKG

rcon-node

Version:

A TypeScript RCON client library for modern game servers.

18 lines 837 B
export type Matcher = RegExp | string; import type { Socket } from "node:net"; /** * Wait until the socket receives data matching the provided pattern. * @param socket The TCP socket. * @param matcher String or regular expression to match. * @returns Resolves with the received data once the matcher is satisfied. */ export declare function readUntil(socket: Socket, matcher: Matcher): Promise<string>; /** * Send a command to the socket and read until the pattern is seen again. * @param socket The TCP socket. * @param command Command text to send. * @param matcher Pattern signalling the end of the response. * @returns Resolves with the captured response text. */ export declare function sendAndRead(socket: Socket, command: string, matcher: Matcher): Promise<string>; //# sourceMappingURL=seven-days-to-die.utils.d.ts.map