recently-modified-files
v0.1.1
Published
Gets the most recent modified file on a dir
Downloads
2
Readme
recently-modified-files
Gets a list of recently modified files in a dir
Install
npm install --save recently-modified-files
Usage
import rmf from 'recently-modified-files'
rmf(dir, fn)
params
dir
{string} The dir to test for filesfn
{Function} Callback, the arguments areerr
{Error} Possible exception or nullfiles
{Array} An array with the names of the files where the first one is the most recently modified file or an empty array when there are no files
const filenames = rmf.sync(dir)
params
dir
{string} The path to test for files
return
An array of strings with the filenames on path
in descending order with respect to the modified time
rmf.promise(dir)
params
dir
{string} The path to test for files
return
A native promise, note that it's required that global.Promise
is defined
NOTE: the test to check if a file is a file is by calling stat.isFile()
which means that folders/symlinks are ignored
License
MIT © 2016 Mauricio Poppe