then-ify

0.0.3 • Public • Published

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
  });

Readme

Keywords

none

Package Sidebar

Install

npm i then-ify

Weekly Downloads

2

Version

0.0.3

License

MIT

Last publish

Collaborators

  • ajhsu