scanFolder
An NPM module for recursively looking for a single type of file within a directory with options for ignoring dotfolders/dotfiles and scanning recursively.
Usage
Import the node module:
`npm install scan-folder`
Scan a folder:
var scanFolder = require("scan-folder");
// find js files in current dir
scanFolder(__dirname, "js");
Scan a folder recursively:
// find js files in all dirs
scanFolder(__dirname, "js", true);
Scan a folder with exceptions for special files/folders
// find js files in all dirs including folders starting with .
scanFolder(__dirname, "js", true, { dotfolders: true });
var allow = {
dotfolders: true, // .folders, default false
dotfiles: true, // .files, default false
modules: true // node_modules, default false
};
scanFolder(__dirname, "js", true, allow);