MCPcopy Create free account
hub / github.com/ChromeDevTools/chrome-devtools-mcp / waitForFile

Function waitForFile

src/daemon/client.ts:69–80  ·  view source on GitHub ↗

* Waits for a file to be created and populated.

(filePath: string)

Source from the content-addressed store, hash-verified

67 * Waits for a file to be created and populated.
68 */
69async function waitForFile(filePath: string): Promise<void> {
70 await waitFor(() => {
71 if (!fs.existsSync(filePath)) {
72 return false;
73 }
74 try {
75 return fs.statSync(filePath).size > 0;
76 } catch {
77 return false;
78 }
79 }, `Timeout: file ${filePath} not found within ${FILE_TIMEOUT}ms`);
80}
81
82async function waitForDaemonReady(sessionId: string): Promise<void> {
83 const deadline = Date.now() + FILE_TIMEOUT;

Callers 1

startDaemonFunction · 0.85

Calls 1

waitForFunction · 0.85

Tested by

no test coverage detected