Wrap any node-style callback function with a promise.
npm install typeable-promisify
yarn add typeable-promisify
pnpm add typeable-promisify
bun add typeable-promisify
// @flow import promisify from 'typeable-promisify'; let writeFileAsync = (filePath: string, fileContents: string): Promise<void> => { return promisify(cb => writeFile(filePath, fileContents, cb)); }; writeFileAsync('fileName', 'fileContents').then(() => {});