index.js
function recursiveReaddirSync(path) {
  var list = []
    , files = fs.readdirSync(path)
    , stats
    ;

  files.forEach(function (file) {
    stats = fs.lstatSync(p.join(path, file));
    if(stats.isDirectory()) {
      list = list.concat(recursiveReaddirSync(p.join(path, file)));
    } else {
      list.push(p.join(path, file));
    }
  });

  return list;
}
function recursiveReaddirSync(path) {
  var list = []
    , files = fs.readdirSync(path)
    , stats
    ;

  files.forEach(function (file) {
    stats = fs.lstatSync(p.join(path, file));
    if(stats.isDirectory()) {
      list = list.concat(recursiveReaddirSync(p.join(path, file)));
    } else {
      list.push(p.join(path, file));
    }
  });

  return list;
}
function recursiveReaddirSync ( path ) { var list = [ ] , files = fs . readdirSync ( path ) , stats ; files . forEach ( function ( file ) { stats = fs . lstatSync ( p . join ( path , file ) ) ; if ( stats . isDirectory ( ) ) { list = list . concat ( recursiveReaddirSync ( p . join ( path , file ) ) ) ; } else { list . push ( p . join ( path , file ) ) ; } } ) ; return list ; }
how to know when you are done?
how to know when you are done?