コード例 #1
0
ファイル: index.js プロジェクト: mrjoelkemp/node-zombies
  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);
    });
  });
コード例 #2
0
ファイル: index.js プロジェクト: behance/node-y-u-no-bundle
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); }
  });
};