typeable-promisify

2.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i typeable-promisify

Weekly Downloads

9,928

Version

2.0.1

License

MIT

Last publish

Collaborators

  • thejameskyle