I want to read the file created date and want to push that date to one array and send back. Its showing date when am calling it inside of fs.stat method
      fs.stat('./templates/'+file , function(err, stats){
      var createdDate = stats.birthtime;
      console.log(createdDate , showing date)
        })
but when am trying to call it oustide of that method its showing undefined
      fs.stat('./templates/'+file , function(err, stats){
      var createdDate = stats.birthtime;
        })
       console.log(createdDate , undefined)