index.js
function isJavaScriptFile(filepath) {
  if (!fs.statSync(filepath).isFile()) {
    return false;
  }
  if (path.basename(filepath) === 'index.js') {
    return false;
  }
  return filepath.slice(-3) === '.js';
}
function isJavaScriptFile(filepath) {
  if (!fs.statSync(filepath).isFile()) {
    return false;
  }
  if (path.basename(filepath) === 'index.js') {
    return false;
  }
  return filepath.slice(-3) === '.js';
}
function isJavaScriptFile ( filepath ) { if ( ! fs . statSync ( filepath ) . isFile ( ) ) { return false ; } if ( path . basename ( filepath ) === 'index.js' ) { return false ; } return filepath . slice ( - 3 ) === '.js' ; }
Return true if the file is a `.js` file.

@param {String} filepath
@return {Boolean}
Return true if the file is a . js file .