typeable-promisify

Wrap any node-style callback function with a promise.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
typeable-promisify
2.0.17 years ago7 years agoMinified + gzip package size for typeable-promisify in KB

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(() => {});