tempfiles

Periodically remove old files from a directory

npm install tempfiles
1 downloads in the last week
1 downloads in the last month

TEMPFILES

Tempfiles removes all files from a directory.

Installation

npm install tempfiles

Usage

  • cleanPeriodically(dir, ttl, callback) - starts a timer to clean files that are older than ttl (in seconds)

Example:

var tempfiles = require("tempfiles");

tempfiles.cleanPeriodically("/tmp/ttl", 60, function(err, timer){
    if(!err)
        console.log("Cleaning periodically directory /tmp/ttl");
});
npm loves you