Node.js · Junior · Question 36 of 75
What does util.promisify do?
- 1Makes any synchronous function run in another thread
- 2Converts a promise into a callback
- ✓Correct answer: Turns a function that takes an error-first callback into a function that returns a promise
Explanation
It's useful for old APIs and libraries that only support callbacks. The opposite helper is util.callbackify.