index.js
function updateDepth(parentUrl, linkUri, callback) {

    var depths = {parentUrl : parentUrl, linkUri : linkUri, parentDepth : 0, linkDepth : 0};
    var execFns = async.seq(getDepths , calcultateDepths , saveDepths);

    execFns(depths, function (error, result) {
      if (error) {
         return callback(error);
      }
      callback(error, result.linkDepth);
    });

}
function updateDepth(parentUrl, linkUri, callback) {

    var depths = {parentUrl : parentUrl, linkUri : linkUri, parentDepth : 0, linkDepth : 0};
    var execFns = async.seq(getDepths , calcultateDepths , saveDepths);

    execFns(depths, function (error, result) {
      if (error) {
         return callback(error);
      }
      callback(error, result.linkDepth);
    });

}
function updateDepth ( parentUrl , linkUri , callback ) { var depths = { parentUrl : parentUrl , linkUri : linkUri , parentDepth : 0 , linkDepth : 0 } ; var execFns = async . seq ( getDepths , calcultateDepths , saveDepths ) ; execFns ( depths , function ( error , result ) { if ( error ) { return callback ( error ) ; } callback ( error , result . linkDepth ) ; } ) ; }
Compute the crawl depth for a link in function of the crawl depth
of the page that contains the link

@param The URI of page that contains the link
@param The link for which the crawl depth has to be calculated
@param callback(error, depth)
Compute the crawl depth for a link in function of the crawl depth of the page that contains the link