var detective = require('detective');
var unique = require('array-unique');
var recursive = require('recursive-readdir');
var fs = require('fs');
var core = require('is-core-module');
var local = /^\.|\//;

// Only js and not from node_modules
var onlySourceFiles = function(filename) {
	return filename
		&& filename.slice(filename.length - 3) === '.js'
		&& filename.indexOf('node_modules') === -1;
};

var onlyDependencies = function(filename) {
	return !local.test(filename)
		&& !core(filename);
};

var find = function(path, cb) {
	recursive(path, function (err, filenames) {
		var jsFiles = filenames.filter(onlySourceFiles);

		var counter = 0;
		var requires = [];

		for (var i in jsFiles) {
			counter++;
			var filename = jsFiles[i];

			fs.readFile(filename, function(err, content) {
				if (err) {
					return cb(err, null);
				}

				counter--;
				requires = requires.concat(detective(content));

				if (counter === 0) {
					cb(null, unique(requires.filter(onlyDependencies)));
				}
			});
		}
	});
};

module.exports = find;

@@ -674,75 +674,57 @@
 %0A%0A%09%09
-for (var i in jsFiles) %7B%0A%09%09%09counter++;%0A%09%09%09var filename = jsFiles%5Bi%5D
+jsFiles.forEach(function(filename) %7B%0A%09%09%09counter++
 ;%0A%0A%09
@@ -988,16 +988,18 @@
 %09%7D);%0A%09%09%7D
+);
 %0A%09%7D);%0A%7D;

Replace for in loop with forEach.