2.0.1 • Published 7 years ago

typeable-promisify v2.0.1

Weekly downloads
11,837
License
MIT
Repository
-
Last release
7 years ago

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