typeable-promisify

v2.0.1
Wrap any node-style callback function with a promise.

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(() => {});
npm i typeable-promisify

Metadata

  • MIT
  • Whatever
  • James Kyle
  • released 8/15/2017

Downloads

Maintainers