Created
April 4, 2016 10:34
-
-
Save shaikh-shahid/583a351434a1765ab30d0f10367729ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require("fs"); | |
var db = require('somedbfile.js'); | |
var sendEmail = require('someEmail.js'); | |
fs.readFile('async.js','utf8',function(err,data){ | |
if(!err) { | |
console.log(data); | |
} | |
db.executeQuery('SELECT * FROM test',function(err,rows) { | |
if(!err) { | |
console.log("Error",err); | |
} | |
sendEmail(rows,function(err,data) { | |
if(!err) { | |
console.log("Error",err); | |
} | |
console.log("Operation done, i am in callback hell"); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On line 9, 13 should be
if (err) {
.