js, listen to this root directory and all sub directories and create a JSONHow do I get directory structure in a single call to the filesystem? I have a VSTO application that browses a directory and lists subfolders and files in an excel sheet in a certain format. asynchronous file and directory operations for Node.js.The files and subdirs methods are for getting a list of the files or subdirs in a directory as an array. subdirs( dir, callback ). Do you need to get all files present in the directory or you want to scan a directory for files using node.js, then youre on the correct web page because in this Nodejs How to Tutorial, we will learning How to get the list of allfs.readdir(path, callbackFunction) This method will read all files in the How to list files within a .