Node.js: fs module read directory with with username and password

Viewed 36

I am using node.js, fs module to access Files from Network Drive using its username and password.

So, I am looking for a way to access the directories with fs or any other node.js module using directory path,username and password.

    var fs = require('fs');
    var folderPath = '\\\\10.1.15.23\\users' ;
    // fs should used the below credentials while accessing the folders with fs.readdir or any other way

   const authentication= {username: 'username' & password= 'password'}
    
    fs.readdir(folderPath, 'with username and password', function(err, data) {
      if (err) throw err;
      console.log(data);
    });

Thanks in advance.

0 Answers
Related