utils/file_loader.js
/**
 * Load every file in any directory
 * @param  {string} path
 */
Load every file in any directory
@param  {string} path
Load every file in any directory @param { string } path
function loader(path, callback) {
    fs.readdirSync(path).forEach((file) => {
        const newPath = `${path}/${file}`;
        const stat = fs.statSync(newPath);
        if (stat.isFile()) {
            if (/(.*)\.(js$|coffee$)/.test(file)) {
                callback(newPath, stat);
            }
        } else if (stat.isDirectory()) {
            loader(newPath, callback);
        }
    });
}
function loader ( path , callback ) { fs . readdirSync ( path ) . forEach ( ( file ) => { const newPath = ` ${ path } ${ file } ` ; const stat = fs . statSync ( newPath ) ; if ( stat . isFile ( ) ) { if ( / (.*)\.(js$|coffee$) / . test ( file ) ) { callback ( newPath , stat ) ; } } else if ( stat . isDirectory ( ) ) { loader ( newPath , callback ) ; } } ) ; }
Load every file in any directory
 @param  {string} path
Load every file in any directory @param { string } path