Raja Muhammad Asher
Raja Muhammad Asher

Follow

Raja Muhammad Asher

Follow
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?

Raja Muhammad Asher's photo
Raja Muhammad Asher
·Sep 30, 2022·

1 min read

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

 
Share this