Open this example in the interactive library
Source code
import { promisify } from "node:util";
const double = promisify((n, done) => done(null, n * 2));
console.log(await double(6));
Sample output
12

Open this example in the interactive library
import { promisify } from "node:util";
const double = promisify((n, done) => done(null, n * 2));
console.log(await double(6));
12