scanDirectory
external fun scanDirectory(path: String, callback: (String, String, String, String, dynamic) -> dynamic? = definedExternally, subdirs: Boolean = definedExternally): Promise<Array<String>>
Find files in a directory. The callback can return a custom value per file.
Hidden files and directories are skipped, and subdirectories are scanned unless subdirs is false. The callback receives ext (starts with ., can be empty), file (name without extension), subdir (ends with /, can be empty), the scanned path and file stats. Return false, null or undefined to skip the file, true to include subdir + filename, or a custom value to include it as-is. The callback may be asynchronous.