Synchronous fs call in a server file
Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 4 points from that category, once per scan, no matter how many places it turns up.
What it detects
A blocking fs.*Sync call appears in a file that looks like an Express server. Inside a request handler it freezes the event loop for all concurrent requests. Heuristic: startup-time use is fine.
Why it matters
Node runs your JavaScript on a single thread, so a synchronous fs call blocks that thread until the disk finishes. Inside a request handler that stalls every other in-flight request for the duration, which turns a slow disk or a large file into an availability problem under load. This is a heuristic: the same call at startup, before the server listens, is fine.
How to fix it
Use the async APIs in request paths: await fs.promises.readFile (or the callback form) instead of fs.readFileSync, and the same for write, readdir, and stat. Reserve synchronous fs for one-time startup or CLI code that runs before the server accepts connections. For large files, stream them rather than reading the whole thing into memory.
The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing
Does your repo trip this check?
Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.
Scan your repo