Skip to content

Instantly share code, notes, and snippets.

@davybrion
Created September 15, 2012 16:52
Show Gist options
  • Save davybrion/3728804 to your computer and use it in GitHub Desktop.
Save davybrion/3728804 to your computer and use it in GitHub Desktop.
code snippet for "Solving A Problem By Avoiding It" post
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