I'm new to node and I'm trying to get a list of files in a network drive using the directory-tree plugin but I'm getting a null return. Has anyone had this problem
var dirTree = require('directory-tree');
var tree = dirTree('\\\\10.10.1.6\\Images');
console.log(tree);
There can be another way to find the contents in the directory which is using smb2 module. As network drive requires user credentials to access its contents therefore it is returning null. Also if we try to access it using file system of Node js then it may also return access denied. So to access the contents of network location we can use external node library i.e SMB2
An example for the same can be -