creap

1.0.0 • Public • Published

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).

Dependencies (4)

Dev Dependencies (2)

Package Sidebar

Install

npm i creap

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • swatinem
  • jongleberry