Created
September 15, 2012 16:52
-
-
Save davybrion/3728804 to your computer and use it in GitHub Desktop.
code snippet for "Solving A Problem By Avoiding It" post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var exec = require('child_process').exec; | |
function getJsFilesRecursively(startPath, callback) { | |
exec('find ' + startPath, function(err, stdout) { | |
var jsFiles = []; | |
stdout.split('\n').forEach(function(f) { | |
if (!/node_modules\//.test(f) && /.js$/.test(f)) { | |
jsFiles.push(f); | |
}; | |
}); | |
callback(null, jsFiles); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment