Recursively read a directory and return an array of all file paths
90
Build a simple command-line tool that creates an inventory of all non-hidden files in a directory tree. The tool should scan a specified directory recursively and generate a report listing all visible files.
Your tool should accept a directory path as input and output a list of all files found, excluding any hidden files or directories (those starting with a dot). The output should show relative paths from the provided directory.
The tool must:
@generates
/**
* Creates an inventory of all non-hidden files in a directory tree.
*
* @param {string} dirPath - The directory path to scan
* @returns {string[]} Array of relative file paths (excluding hidden files)
*/
function getInventory(dirPath) {
// IMPLEMENTATION HERE
}
module.exports = { getInventory };Provides recursive directory reading support.
Install with Tessl CLI
npx tessl i tessl/npm-fs-readdir-recursive