typeable-promisify
v2.0.1
Published
Wrap any node-style callback function with a promise.
Downloads
24,003
Readme
typeable-promisify
- Wrap any node-style callback function with a promise.
- Allows you to specify your own type annotations.
- Strongly typed.
// @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(() => {});