Asynchronous Vs synchronous in NodeJS

javascript, node.js

Solution

Async:

- Send request

- go on with other code

- response come in any time on a callback

Sync:

- Send request

- Wait for response

- go on with other code after response

Problem

I'm new to NodeJS. I have seen there are separate asynchronous and synchronous functions for the same task (ex: {`fs.writeFile,fs.writeFileSync`} , {`fs.read, fs.readSync`}). Can anyone explain why is that? and what is the difference?

Original source