lib/Persistence.js
function getOldestFilename (callback) {
  getLogFiles(function (err, files) {
    if (err) {
      callback(err, null);
    } else if (!files || files.length === 0) {
      return callback(null, Date.now().toString().concat(FILE_EXT));
    } else {
      var file = _.min(files, function (f) {
        // Remove extension to get just the timestamp
        var ts = f.name.replace(FILE_EXT, '');

        return parseInt(ts, 10);
      });

      callback(null, file.name);
    }
  });
}
function getOldestFilename (callback) {
  getLogFiles(function (err, files) {
    if (err) {
      callback(err, null);
    } else if (!files || files.length === 0) {
      return callback(null, Date.now().toString().concat(FILE_EXT));
    } else {
      var file = _.min(files, function (f) {
        // Remove extension to get just the timestamp
        var ts = f.name.replace(FILE_EXT, '');

        return parseInt(ts, 10);
      });

      callback(null, file.name);
    }
  });
}
Get the name of the most recent log file
@param  {Array}    files
@param  {Function} callback