How the Stream API works
masterThe readdirp(root, options) function returns a stream that recursively reads the root directory.
Event Lifecycle:
data: Emitted for every file or directory found.warn: Emitted for non-fatal errors (e.g., a directory that is inaccessible). The stream continues.error: Emitted for fatal errors (e.g., invalid options). The stream ends.end: Emitted when all entries have been found and no more will be emitted.close: Emitted when the stream is destroyed viastream.destroy(). This is useful for manually aborting the process.