typeable-promisify

Wrap any node-style callback function with a promise.

MIT 4 个版本
安装
npm install typeable-promisify
yarn add typeable-promisify
pnpm add typeable-promisify
bun add typeable-promisify
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(() => {});
版本列表
2.0.1 2017-08-15
2.0.0 2017-05-30
1.0.1 2017-05-12
1.0.0 2017-05-12