lib/exif-renamer.js
function(filepath, index) {
        index = index || 1;
        var params = this.get_path_info(filepath);
        params.index = index;
        var newpath = Handlebars.compile(this.config.sequential_template)(params);
        return (fs.existsSync(newpath)) ? this.get_sequential_filepath(filepath, index + 1) : newpath;
    }
function(filepath, index) {
        index = index || 1;
        var params = this.get_path_info(filepath);
        params.index = index;
        var newpath = Handlebars.compile(this.config.sequential_template)(params);
        return (fs.existsSync(newpath)) ? this.get_sequential_filepath(filepath, index + 1) : newpath;
    }
function ( filepath , index ) { index = index || 1 ; var params = this . get_path_info ( filepath ) ; params . index = index ; var newpath = Handlebars . compile ( this . config . sequential_template ) ( params ) ; return ( fs . existsSync ( newpath ) ) ? this . get_sequential_filepath ( filepath , index + 1 ) : newpath ; }
Returns the next available sequential filename for a given conflicting filepath
@param  {String} filepath
@return {String}
Returns the next available sequential filename for a given conflicting filepath