TehShrike / then-denodeify

denodeify from then/Promise, all by itself

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Copied from https://github.com/then/promise/blob/master/src/node-extensions.js without anything else.

Build Status

Converts a function that calls an error-first callback into a function that returns a promise.

var denodeify = require('then-denodeify')

var stat = denodeify(fs.stat)

stat('/tmp/butts').then(function(results) {

})

However if the original function happens to return a promise instead of calling the callback, everything will work as it should.

About

denodeify from then/Promise, all by itself


Languages

Language:JavaScript 100.0%