reap
Delete files in a directory based on last accessed or last modified time.
API
var reaper = new Reaper()
var Reaper = ;var reaper = ;
reaper.watch(dir)
A directory to reap.
reaper;reaper;
reaper.maxAge(ms)
Set the max age based on mtime
for deletion,
defaulting to Infinity
.
reaper.maxAccessedAge(ms)
Set the max age based on atime
for deletion,
defaulting to Infinity
.
reaper.run().then( => )
Recursively iterate through directories and delete old files. Only one file descriptor is used at a time, so you shouldn't see any significant performance loss. For best performance, use a lot of folders.