npm.io
0.0.3 • Published 9 years ago

then-ify

Licence
MIT
Version
0.0.3
Deps
0
Vulns
0
Weekly
0

then-ify

Make your synchronous function thenable.

NPM version Build status License

Install

$ npm install then-ify --save

Example

var thenify = require('then-ify');

// Here we have a synchronous function
function syncFunction(input) { return input * input; }

// Now you can call .then with then-ify
thenify(syncFunction)(3)
  .then(function(output){
    // output = 9
  });