How to get file created date using file System in nodejs?
<p>I want to send to client filename and file created date, I tried to use fs.stat that provides birthtime but i dont see filename in there, SO my question, is birthtime is file created date ? </p>

<p>How can i send filename and date created as json ?</p>

<p>app.js</p>

<pre><code>var readDirectory = require('./readDirectory');
app.get('/logs',function(req,res){
    readDirectory.readDirectory(function(logFiles){
        res.json(logFiles);
    });
});
</code></pre>

<p>readDirectory.js</p>

<pre><code>var fs = require('fs');
var path = './logs/ditLogs'
function readDirectory(callback){
    fs.stat(path, function (err,stats) {
        console.log('STATS',stats);
        callback(stats);
    });

}
exports.readDirectory = readDirectory;
</code></pre>