Open this example in the interactive library
Source code
import * as util from "node:util";
console.log(await util.promisify((a, b, done) => done(null, a + b))(2, 3));
Sample output
5

Open this example in the interactive library
import * as util from "node:util";
console.log(await util.promisify((a, b, done) => done(null, a + b))(2, 3));
5