function scanFolder(folderPath) {
  return fs
    .readdirAsync(folderPath)
    .map((itemName) => statItem(folderPath, itemName))
    .then(parseFolderItems)
    .catch(() => ({
      videos: [],
      other: []
    }));
}
/**
 * Extracts videos and other files from folder and its subfolders
 * @param  {String} folderPath Path of the folder.
 * @return {Object}            Object containing videos and other files.
 */
Extracts videos and other files from folder and its subfolders
@param  {String} folderPath Path of the folder.
@return {Object}            Object containing videos and other files.
Extracts videos and other files from folder and its subfolders @param { String } folderPath Path of the folder . @return { Object } Object containing videos and other files .
function scanFolder(folderPath) {
  return fs
    .readdirAsync(folderPath)
    .map((itemName) => statItem(folderPath, itemName))
    .then(parseFolderItems)
    .catch(() => ({
      videos: [],
      other: []
    }));
}
function scanFolder ( folderPath ) { return fs . readdirAsync ( folderPath ) . map ( ( itemName ) => statItem ( folderPath , itemName ) ) . then ( parseFolderItems ) . catch ( ( ) => ( { videos : [ ] , other : [ ] } ) ) ; }
Extracts videos and other files from folder and its subfolders
 @param  {String} folderPath Path of the folder.
Extracts videos and other files from folder and its subfolders @param { String } folderPath Path of the folder .