typeable-promisify
Wrap any node-style callback function with a promise.
Last updated 9 years ago by thejameskyle .
MIT · Original npm · Tarball · package.json
$ cnpm install typeable-promisify 
SYNC missed versions from official npm registry.

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

Current Tags

  • 2.0.1                                ...           latest (9 years ago)

4 Versions

  • 2.0.1                                ...           9 years ago
  • 2.0.0                                ...           9 years ago
  • 1.0.1                                ...           9 years ago
  • 1.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (1)

Copyright 2013 - present © cnpmjs.org | Home |