creap
v1.0.0
Published
delete old files in directories
Downloads
2
Readme
Creap
reap, but rewritten with promises. Delete files in a folder older than a certain time.
- Only asynchronous file calls are used
- Doesn't support folder/file filtering yet
- Doesn't support concurrency
API
var creap = Creap()
Initialize a new creaper.
var Creap = require('creap')
var creap = Creap()
creap.threshold=
Set the maximum mtime
age.
Could either be milliseconds or a human string like 30 minutes
.
creap.watch(dir)
Watch a directory to recursively look for old files.
creap.run().then()
Delete all the old files in all the directories.
var interval = creap.setInterval([onerror], [interval])
Run the reaper on an interval
.
If an error occurs, onerror(err)
is called,
defaulting to console.error(err.stack)
.