Method description:
Read the file directory asynchronously.
Grammar:
Since this method belongs to the fs module, the fs module needs to be introduced before use (var fs= require(“fs”) )
Receive parameters:
path Directory path
callback Callback, pass two parameters err and files, files is an array containing "all file names in the specified directory".
Example:
Source code: