How to use the search function from node-dir
Find comprehensive JavaScript node-dir.search code examples handpicked from public code repositorys.
10 11 12 13 14 15 16 17 18 19 20 21
// Optionally execute a command in each directory const command = argv.c || argv.command || ''; dir.subdirs(rootDirectory, function(err, subdirs) { const gitDirectories = subdirs .filter(dir => dir.search(/\.git$/) >= 0) .map(dir => path.resolve(process.cwd(), dir.slice(0, dir.length - 4))); // Run command in every directory. if (command.length) {
0
4
0
+ 2 other calls in file
node-dir.readFiles is the most popular function in node-dir (61 examples)