Skip to content

Instantly share code, notes, and snippets.

@shaikh-shahid
Created April 4, 2016 10:34
Show Gist options
  • Save shaikh-shahid/583a351434a1765ab30d0f10367729ea to your computer and use it in GitHub Desktop.
Save shaikh-shahid/583a351434a1765ab30d0f10367729ea to your computer and use it in GitHub Desktop.
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");
});
});
});
@simonhughes
Copy link

On line 9, 13 should be if (err) {.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment