Copied from https://github.com/then/promise/blob/master/src/node-extensions.js without anything else.
Converts a function that calls an error-first callback into a function that returns a promise.
var denodeify = var stat =
However if the original function happens to return a promise instead of calling the callback, everything will work as it should.