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

Function waitForFile

src/daemon/client.ts:70–81  ·  view source on GitHub ↗

* Waits for a file to be created and populated.

(filePath: string)

Source from the content-addressed store, hash-verified

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

Callers 1

startDaemonFunction · 0.85

Calls 1

waitForFunction · 0.85

Tested by

no test coverage detected