lib/main.js
function fetchComponent(compName, filter, options) {
    var componentFiles = [];
    _.each(filter, function(destDir, expression) {
      var fileInfo = path.parse(path.resolve(BOWER_DIRECTORY, compName, expression));
      var sourceDir = fileInfo.dir;

      var dirContent = fs.readdirSync(sourceDir);
      var expressionObj = {};
      expressionObj[expression] = destDir;

      dirContent = dirContent.map(function(file) {
        return path.resolve(BOWER_DIRECTORY, compName, file);
      });

      Array.prototype.push.apply(componentFiles,
        filterByExpression(dirContent, expressionObj, options));

    });
    console.log(componentFiles.length + ' file(s) found for ' + compName);
    var bowerObj = getBower(compName);
    return new Component(bowerObj, componentFiles);
  }
function fetchComponent(compName, filter, options) {
    var componentFiles = [];
    _.each(filter, function(destDir, expression) {
      var fileInfo = path.parse(path.resolve(BOWER_DIRECTORY, compName, expression));
      var sourceDir = fileInfo.dir;

      var dirContent = fs.readdirSync(sourceDir);
      var expressionObj = {};
      expressionObj[expression] = destDir;

      dirContent = dirContent.map(function(file) {
        return path.resolve(BOWER_DIRECTORY, compName, file);
      });

      Array.prototype.push.apply(componentFiles,
        filterByExpression(dirContent, expressionObj, options));

    });
    console.log(componentFiles.length + ' file(s) found for ' + compName);
    var bowerObj = getBower(compName);
    return new Component(bowerObj, componentFiles);
  }
function fetchComponent ( compName , filter , options ) { var componentFiles = [ ] ; _ . each ( filter , function ( destDir , expression ) { var fileInfo = path . parse ( path . resolve ( BOWER_DIRECTORY , compName , expression ) ) ; var sourceDir = fileInfo . dir ; var dirContent = fs . readdirSync ( sourceDir ) ; var expressionObj = { } ; expressionObj [ expression ] = destDir ; dirContent = dirContent . map ( function ( file ) { return path . resolve ( BOWER_DIRECTORY , compName , file ) ; } ) ; Array . prototype . push . apply ( componentFiles , filterByExpression ( dirContent , expressionObj , options ) ) ; } ) ; console . log ( componentFiles . length + ' file(s) found for ' + compName ) ; var bowerObj = getBower ( compName ) ; return new Component ( bowerObj , componentFiles ) ; }
Constructs a Component object
@param  {String} compName
@param  {Object} filter
@param  {Object} options
@return {Component}
Constructs a Component object