var one = function (data, done) {
return done(null, data+4);
};
var pr = new Promise((resolve, reject) => {
return resolve(1);
});
pr.then(i => {
return one(i, function(err, result) {
if(err) throw new Error('OMG!');;
return result;
});
}).then(res => {
console.log(res);
return res;
}).catch(err => {console.log(err)});