How many types of API functions are there in
Node.js?

Photo by Max Chen on Unsplash

How many types of API functions are there in Node.js?

There are two types of API functions in Node.js:

  • Asynchronous, non-blocking functions use the callback pattern, in which a callback function is passed as an argument to the function and is executed when the function completes.

  • Synchronous, blocking functions have a Sync suffix in their name, such as fs.readFileSync