fs-reap

2.0.0 • Public • Published

reap

NPM version Build status Test coverage Dependency Status License Downloads Gittip

Delete files in a directory based on last accessed or last modified time.

API

var reaper = new Reaper()

var Reaper = require('fs-reap');
var reaper = new Reaper();

reaper.watch(dir)

A directory to reap.

reaper.watch('/tmp');
reaper.watch('build');

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.

/fs-reap/

    Package Sidebar

    Install

    npm i fs-reap

    Weekly Downloads

    0

    Version

    2.0.0

    License

    MIT

    Last publish

    Collaborators

    • jongleberry