getRoots(directory, options, function(roots) { // console.log('Roots: ', roots) getDriverScripts(roots, function(drivers) { // console.log('Drivers: ', drivers) var zombies = difference(roots, drivers); // console.log('Zombies: ', zombies) cb(zombies); }); });
module.exports = function(root, config, cb) { if (!root) { throw new Error('root not given'); } if (!config) { throw new Error('config not given'); } var moduleNames = getModuleNames(config); getDriverScripts(root, function(drivers) { var strippedDriverScripts = drivers.map(function(scriptName) { var token = scriptName .replace(new RegExp(root + '\/?'), '') .replace('.js', ''); return token || scriptName; }); var notBundled = difference(strippedDriverScripts, moduleNames); if (cb) { cb(notBundled); } }); };