fs.writeSync()

The Node.js function that writes to a file descriptor and returns only when the write is done, blocking the thread meanwhile.

In more detail

In a crash handler it guarantees the message is written before the process ends: fs.writeSync(2, text) writes to standard error. Outside such special cases prefer the asynchronous versions, because synchronous writes block the event loop.

Related terms

Taught in

References