puter.workers.get()


Gets the information for a specific worker.

Syntax

puter.workers.get(workerName)

Parameters

workerName (String)(Required)

The name of the worker to get the information for.

Return Value

A Promise that resolves to the worker's information as an object.

Examples

Basic Usage

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        (async () => {
            // Get a worker's information
            const workerInfo = await puter.workers.get('my-api');
            if (workerInfo) {
                puter.print(`Worker information: ${JSON.stringify(workerInfo, null, 2)}`);
            } else {
                puter.print('Worker not found!');
            }
        })();
    </script>
</body>
</html>