Skip to content

Function: withClient() ​

ts
function withClient<E, T>(options, fn): Promise<T>;

Defined in: netconf/src/index.ts:45

Connect, run fn, and always close the client afterwards, whether fn succeeds or throws.

Type Parameters ​

E ​

E extends readonly Extension<string, object, object>[] = []

T ​

T = unknown

Parameters ​

options ​

ConnectOptions<E>

fn ​

(client) => Promise<T>

Returns ​

Promise<T>

Released under the MIT Licence.