6 ms·
fs.readFileSync() blocks the event loop preventing any other code from being run or other events/requests from being processed. Await yields control back so tha
by jeswin 7y ago
fs.readFileSync() blocks the event loop preventing any other code from being run or other events/requests from being processed. Await yields control back so that other requests can be processed while the file is being read.
- galaxyLogic 7y agoAh I see. Genius. So is there ever a use-case for NOT using the Async/Await -version of readFile()? Is fsReadSync() now just legacy which we don't need any more?