To avoid callback hell while working with the fs module, you can use the ______ API, which returns promises.

  • async
  • await
  • util.promisify
  • Promise
To avoid callback hell when working with the fs module in Node.js, you can use the util.promisify API, which converts callback-based functions into promise-based functions. This allows you to work with promises and async/await syntax, improving code readability and maintainability.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *