UNPKG

yargs-file-commands

Version:

A yargs helper function that lets you define your commands structure via directory and file naming conventions.

29 lines (28 loc) 1.1 kB
/** * Options for directory scanning * @interface ScanDirectoryOptions */ export interface ScanDirectoryOptions { /** File extensions to consider when scanning for command files */ extensions?: string[]; /** Regular expressions for patterns to ignore when scanning directories */ ignorePatterns?: RegExp[]; /** Logging verbosity level */ logLevel?: 'info' | 'debug'; /** Prefix for log messages */ logPrefix?: string; } /** * Recursively scans a directory for command files * @async * @param {string} dirPath - The directory path to scan * @param {ScanDirectoryOptions} options - Scanning configuration options * @returns {Promise<string[]>} Array of full paths to command files * * @description * Performs a recursive directory scan, filtering files based on: * - Ignore patterns (skips matching files/directories) * - File extensions (only includes matching files) * The scan is performed in parallel for better performance. */ export declare const scanDirectory: (dirPath: string, commandDir: string, options?: ScanDirectoryOptions) => Promise<string[]>;