fshost / node-dir

Recursive asynchronous file and directory operations for Node.js
MIT License
221 stars 44 forks source link

Getting date added timestamp of file #59

Open ridhwaans opened 5 years ago

ridhwaans commented 5 years ago

This piece of code gets all the files in a given directory

var node_dir = require('node-dir');
...
node_dir.files(dir, function(err, files) {
          files.forEach( function( file, index ) {
            file = file.replace(/^.*[\\\/]/, ''); // get filename from full filepath
            console.log('GET: ' + file);

I want to know if node-dir can get the datetime when a file is added to a directory, as it knows the full path. Should work on Windows, Linux & Mac filesystems.