index.js
function loaded(err)
  {
    if(err)
    {
      log.error(err);
      cbMesh(err);
      return false;
    }

    return telehash.mesh(args, function(err, mesh){
      if(!mesh) return cbMesh(err);

      // sync links automatically to file whenever they change
      if(linksFile) mesh.linked(function(json, str){
        log.debug('syncing links json',linksFile,str.length);
        fs.writeFileSync(linksFile, str);
      });

      cbMesh(err, mesh);
    });
  }
function loaded(err)
  {
    if(err)
    {
      log.error(err);
      cbMesh(err);
      return false;
    }

    return telehash.mesh(args, function(err, mesh){
      if(!mesh) return cbMesh(err);

      // sync links automatically to file whenever they change
      if(linksFile) mesh.linked(function(json, str){
        log.debug('syncing links json',linksFile,str.length);
        fs.writeFileSync(linksFile, str);
      });

      cbMesh(err, mesh);
    });
  }
function loaded ( err ) { if ( err ) { log . error ( err ) ; cbMesh ( err ) ; return false ; } return telehash . mesh ( args , function ( err , mesh ) { if ( ! mesh ) return cbMesh ( err ) ; // sync links automatically to file whenever they change if ( linksFile ) mesh . linked ( function ( json , str ) { log . debug ( 'syncing links json' , linksFile , str . length ) ; fs . writeFileSync ( linksFile , str ) ; } ) ; cbMesh ( err , mesh ) ; } ) ; }
set up some node-specific things after the mesh is created
set up some node - specific things after the mesh is created