find-file-paths

0.0.0 • Public • Published

find-file-paths

Small utility to recursively search for files based on an array of search & exclude patterns which returns an array of absolute paths for the files found.

Install

npm install find-file-paths

Usage

findPaths = require 'find-file-paths'
 
startDir = process.cwd() + '/test'
 
greedy = true
 
searchPatterns = [
  'ui-tests/'         # Matches all files in "#{startDir}/ui-tests/*" 
  'load-tests/login'  # Matches all files in "#{startDir}/load-tests/login*" 
  '*smoke*'           # Matches all files in "#{startDir}/*" with "smoke" in the name 
]
 
excludePatterns = [
  'unit/'     # Excludes all files in "#{startDir}/unit/*" 
  '*.broken'  # Excludes all files with ".broken" in the name 
]
 
allAbsoluteFilePaths = findPaths searchPatternsexcludePatternsgreedystartDir
 

More detailed parameter explanations can be found in the code.

Package Sidebar

Install

npm i find-file-paths

Weekly Downloads

0

Version

0.0.0

License

MIT

Last publish

Collaborators

  • whoaa