FilePaths is a Generator function listing paths of files in a given list of directories and satisfying a given condition.
FilePaths
const {FilePaths} = require ('fs-iterators') for (const path of FilePaths ({ dir: ['/home/my_project/views'] filter: (fileName, directoryPath, filePath) => /^vw_/.test (fileName) })) console.log ({path})
dir
An iterable of directories' full paths to scan (linearly, without subdirectories).
Normally, a DirList instance is presumed here (to process hierarchy), but a raw Array and any other iterable object may be used.
filter
typeof filter
undefined
string
function
filter (localName, directoryPath, fullPath)
In the latter case, the filter function is called with the following arguments:
fileName
String
directoryPath
filePath
path.sep
If the result is truthy, the filePath value is yielded.
There was an error while loading. Please reload this page.