Answer the question
In order to leave comments, you need to log in
typescript. Why does bluebird.promisify for fs.unlink still require a callback function?
Question for TS connoisseurs
We want to do unlink through the standard fs module. We use bluebird:
import { promisify } from 'bluebird';
await promisify(fs.unlink)(file);
import { promisify } from 'bluebird';
const _unlink = promisify(fs.unlink) as any;
await _unlink(file);
Answer the question
In order to leave comments, you need to log in
I would smoke the source codes on the subject of why this happens. At the very least, you can at least something like this:
interface StringToPromise {
(string): Promise<object>;
}
const _unlink = promisify(fs.unlink) as StringToPromise;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question