lib/main.js
function fetchComponents(filter, options) {
    console.log('Fetching dependencies...');

    var componentList = [];

    if (_.isObject(filter) || _.isArray(filter)) {
      var dependencies = fetchBowerComponents();
      _.each(dependencies, function(dep) {
        var bowerObj = getBower(dep);
        if (bowerObj) {
          var mainFiles = fetchMainFiles(bowerObj);

          var componentFiles = [];
          _.each(filter, function(destDir, expression) {
            var expressionObj = {};
            expressionObj[expression] = destDir;

            var filteredValues = filterByExpression(mainFiles, expressionObj, options);

            Array.prototype.push.apply(componentFiles,
              filteredValues);
          });

          // create Component class and encapsulate Component
          // related info in that.
          componentList.push(new Component(bowerObj, componentFiles));

          console.log(componentFiles.length + ' file(s) found for ' + dep);
        }
      });

      console.log('##### Total dependencie(s) found ' + componentList.length);
    }

    return componentList;
  }
function fetchComponents(filter, options) {
    console.log('Fetching dependencies...');

    var componentList = [];

    if (_.isObject(filter) || _.isArray(filter)) {
      var dependencies = fetchBowerComponents();
      _.each(dependencies, function(dep) {
        var bowerObj = getBower(dep);
        if (bowerObj) {
          var mainFiles = fetchMainFiles(bowerObj);

          var componentFiles = [];
          _.each(filter, function(destDir, expression) {
            var expressionObj = {};
            expressionObj[expression] = destDir;

            var filteredValues = filterByExpression(mainFiles, expressionObj, options);

            Array.prototype.push.apply(componentFiles,
              filteredValues);
          });

          // create Component class and encapsulate Component
          // related info in that.
          componentList.push(new Component(bowerObj, componentFiles));

          console.log(componentFiles.length + ' file(s) found for ' + dep);
        }
      });

      console.log('##### Total dependencie(s) found ' + componentList.length);
    }

    return componentList;
  }
function fetchComponents ( filter , options ) { console . log ( 'Fetching dependencies...' ) ; var componentList = [ ] ; if ( _ . isObject ( filter ) || _ . isArray ( filter ) ) { var dependencies = fetchBowerComponents ( ) ; _ . each ( dependencies , function ( dep ) { var bowerObj = getBower ( dep ) ; if ( bowerObj ) { var mainFiles = fetchMainFiles ( bowerObj ) ; var componentFiles = [ ] ; _ . each ( filter , function ( destDir , expression ) { var expressionObj = { } ; expressionObj [ expression ] = destDir ; var filteredValues = filterByExpression ( mainFiles , expressionObj , options ) ; Array . prototype . push . apply ( componentFiles , filteredValues ) ; } ) ; // create Component class and encapsulate Component // related info in that. componentList . push ( new Component ( bowerObj , componentFiles ) ) ; console . log ( componentFiles . length + ' file(s) found for ' + dep ) ; } } ) ; console . log ( '##### Total dependencie(s) found ' + componentList . length ) ; } return componentList ; }
Get components from bower.json
@param  {Object}/{Array} filter
@param  {Object} options
@return {Array<Component>} List of components
Get components from bower . json