app/App.js
/**
   *  Will recursivley parse a directory for items and call itemCallback for each
   *  item found. Will stop when max levels is reached.
   *
   *  @param {string} directory Directory path to scan
   *  @param {int} maxLevels Maximum levels to scan into, 0 for top level, -1 for infinite
   *  @param {function} itemCallback Function called for each item with the
   *                                 following arguments
   *                                  - itemPath {string} Path to the item
   *                                  - value {string} Filename
   *                                  - namespace {string} Preceeding namespace i.e.
   *                                    directory path relative to starting directory
   *                                 the resulting value of the callback is appended
   *                                 to the list of items
   *
   *  @param {array} items (optional) array of items
   *  @param {string} namespace (optional) namespace of current directory
   *  @param {integer} level What level of directory is being scanned
   *  @return {array} items array retrieved via itemCallback
   */
Will recursivley parse a directory for items and call itemCallback for each
item found. Will stop when max levels is reached.

@param {string} directory Directory path to scan
@param {int} maxLevels Maximum levels to scan into, 0 for top level, -1 for infinite
@param {function} itemCallback Function called for each item with the
following arguments
- itemPath {string} Path to the item
- value {string} Filename
- namespace {string} Preceeding namespace i.e.
directory path relative to starting directory
the resulting value of the callback is appended
to the list of items

@param {array} items (optional) array of items
@param {string} namespace (optional) namespace of current directory
@param {integer} level What level of directory is being scanned
@return {array} items array retrieved via itemCallback
Will recursivley parse a directory for items and call itemCallback for each item found . Will stop when max levels is reached . @param { string } directory Directory path to scan @param { int } maxLevels Maximum levels to scan into 0 for top level - 1 for infinite @param { function } itemCallback Function called for each item with the following arguments - itemPath { string } Path to the item - value { string } Filename - namespace { string } Preceeding namespace i . e . directory path relative to starting directory the resulting value of the callback is appended to the list of items @param { array } items ( optional ) array of items @param { string } namespace ( optional ) namespace of current directory @param { integer } level What level of directory is being scanned @return { array } items array retrieved via itemCallback
recursivelyScanDirectory(directory, maxLevels, itemCallback, items, namespace, level) {
    items = items || [];
    namespace = namespace || '';
    level = level || 0;
    let scanItems = fs.readdirSync(directory);
    scanItems.forEach((value) => {
      let itemPath = directory + '/' + value,
          stat = fs.statSync(itemPath);
      if(stat.isDirectory() && (level < maxLevels || maxLevels < 0)) {
        this.recursivelyScanDirectory(itemPath, maxLevels, itemCallback, items, this.resolveNamespace(value, namespace), level + 1);
      } else if(stat.isFile()) {
        items.push(itemCallback(itemPath, value, namespace));
      }
    });
    return items;
  }
recursivelyScanDirectory ( directory , maxLevels , itemCallback , items , namespace , level ) { items = items || [ ] ; namespace = namespace || '' ; level = level || 0 ; let scanItems = fs . readdirSync ( directory ) ; scanItems . forEach ( ( value ) => { let itemPath = directory + '/' + value , stat = fs . statSync ( itemPath ) ; if ( stat . isDirectory ( ) && ( level < maxLevels || maxLevels < 0 ) ) { this . recursivelyScanDirectory ( itemPath , maxLevels , itemCallback , items , this . resolveNamespace ( value , namespace ) , level + 1 ) ; } else if ( stat . isFile ( ) ) { items . push ( itemCallback ( itemPath , value , namespace ) ) ; } } ) ; return items ; }
Will recursivley parse a directory for items and call itemCallback for each
  item found.
Will recursivley parse a directory for items and call itemCallback for each item found .