simple-promisify

1.0.1 • Public • Published

Simple Promisify

takes a functions expecting a nodestyle callback and returns a functions that returns a promise in stead.

Batteries are not included

The library does not come with a promise shim

usage

The promisiify function takes two arguments: the function context, and the function to be curried.

 
const promisify = require('simple-promisify')
const fs = require('fs')
 
const readFile = promisify(fs, fs.readFile)
 

Currying

The promisify function is curried:

 
const promisify = require('simple-promisify')(null)
 
const foo = promisify(functionThatDoesNotRelyOnThis)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    1
  • 1.0.0
    0

Package Sidebar

Install

npm i simple-promisify

Weekly Downloads

1

Version

1.0.1

License

ISC

Last publish

Collaborators

  • oolon