include-common-imports.js
function getJSFiles(folder = srcFolder){
  let all = [];
  let f = fs.readdirSync(folder);
  for(file of f){
    all.push(path.join(folder,file))
    if(fs.lstatSync(path.join(folder,file)).isDirectory()){
      all = all.concat(getJSFiles(path.join(folder,file)));
    }
  }
  return all.filter(x => x.endsWith('.js'));
}
function getJSFiles(folder = srcFolder){
  let all = [];
  let f = fs.readdirSync(folder);
  for(file of f){
    all.push(path.join(folder,file))
    if(fs.lstatSync(path.join(folder,file)).isDirectory()){
      all = all.concat(getJSFiles(path.join(folder,file)));
    }
  }
  return all.filter(x => x.endsWith('.js'));
}
function getJSFiles ( folder = srcFolder ) { let all = [ ] ; let f = fs . readdirSync ( folder ) ; for ( file of f ) { all . push ( path . join ( folder , file ) ) if ( fs . lstatSync ( path . join ( folder , file ) ) . isDirectory ( ) ) { all = all . concat ( getJSFiles ( path . join ( folder , file ) ) ) ; } } return all . filter ( x => x . endsWith ( '.js' ) ) ; }
get all js file paths in a folder recursively
get all js file paths in a folder recursively