0.1.0 • Published 9 years ago
recursive-src-files v0.1.0
recursive-src-files
Simple node package that allows you to iterate over each sub-directory in a given directory and apply a callback to an array of files in the given sub-directory.
Example
Given the following file structure
|- src
|---- module_a
|-------- source_file.js
|-------- source_file_two.js
|---- module_b
|-------- source_file_three.js
|-------- source_file_four.jsWhen you call getSrcFiles() passing in the parameter './src' like so:
var getSrcFiles = require('recursive-src-files');
getSrcFiles('./src', function (files) {
console.log(files);
});you will get as your output:
// console output will be:
['source_file.js', 'source_file_two.js'] // result one
['source_file_three.js', 'source_file_four.js'] // result twoAPI
getSrcFiles(scanDirectory, callback)
scanDirectoryStringcallbackFunction
iterate over each sub-directory in a given directory and apply a callback to an array of files in the given sub-directory.
0.1.0
9 years ago