Skip to main content

Dagger NodeJS SDK

Type Aliases

CallbackFct

CallbackFct: (client: Client) => Promise<void>

Type declaration

(client): Promise<void>

Parameters
NameType
clientClient
Returns

Promise<void>

Functions

close

close(): void

Close global client connection

Returns

void


connect

connect(cb, config?): Promise<void>

connect runs GraphQL server and initializes a GraphQL client to execute query on it through its callback. This implementation is based on the existing Go SDK.

Parameters

NameType
cbCallbackFct
configConnectOpts

Returns

Promise<void>


connection

connection(fct, cfg?): Promise<void>

connection executes the given function using the default global Dagger client.

Parameters

NameType
fct() => Promise<void>
cfgConnectOpts

Returns

Promise<void>

Example

await connection(
async () => {
await dag
.container()
.from("alpine")
.withExec(["apk", "add", "curl"])
.withExec(["curl", "https://dagger.io/"])
.sync()
}, { LogOutput: process.stderr }
)