thunk-to-promise

Converts a thunk to promise.

Downloads
13
Stars
5
Committers
2

thunk-to-promise

Converts a Thunk to a Promise. (Picked from co)

Get it: npm install --save thunk-to-promise

Sample usage:

var readThunk = require("thunkify")(fs.read);

var thunkToPromise = require("thunk-to-promise");

var readPromise = thunkToPromise(readThunk);

// readPromisse is your thunk, that got converted to a Promise.