JSFiddle - React, Tailwind, and code Playground
JavaScript
var files = [ 'C:\\PATH\\TO\\BOWER\\DIR\\bower_components\\knockout\\dist\\abc.js',
'C:\\PATH\\TO\\BOWER\\DIR\\bower_components\\jquery\\dist\\jquery.js',
'C:\\PATH\\TO\\BOWER\\DIR\\bower_components\\bootstrap\\less\\bootstrap.less',
'C:\\PATH\\TO\\BOWER\\DIR\\bower_components\\bootstrap\\dist\\css\\bootstrap.css',
'C:\\PATH\\TO\\BOWER\\DIR\\bower_components\\bootstrap\\dist\\js\\bootstrap.js',
'C:\\PATH\\TO\\BOWER\\DIR\\bower_components\\bootstrap\\dist\\fonts\\glyphicons-halflings-regular.eot',
'C:\\PATH\\TO\\BOWER\\DIR\\bower_components\\bootstrap\\dist\\fonts\\glyphicons-halflings-regular.svg',
'C:\\PATH\\TO\\BOWER\\DIR\\bower_components\\bootstrap\\dist\\fonts\\glyphicons-halflings-regular.ttf',
'C:\\PATH\\TO\\BOWER\\DIR\\bower_components\\bootstrap\\dist\\fonts\\glyphicons-halflings-regular.woff',
'C:\\PATH\\TO\\BOWER\\DIR\\bower_components\\respond\\dest\\respond.src.js',
'C:\\PATH\\TO\\BOWER\\DIR\\bower_components\\q\\q.js' ];
var filter = /js$/i;
//var jsRegEx = new RegExp("js$", "i");
var opts = opts || {};
opts.paths = opts.paths || {};
opts.filter = opts.filter || filter
try {
if (typeof opts.filter === 'string' || Array.isArray(opts.filter)) {
files = globule.match(opts.filter, files);
} else if (opts.filter instanceof RegExp) {
files = files.filter(function(file) {
return opts.filter.test(file);
});
} else if (typeof opts.filter === 'function') {
files = files.filter(opts.filter);
}
} catch (e) {
throw e;
}
console.log("bower files: ", files);