title: how to get list of standard folders with fs.readdir
body: <p>I'm using node.js for something. I need to read all files and folders inside specific path and return standard "folders". for example when I give "MAC HD" as the path I like to get "Applications", "Library, "System", "Users" as result. I need to get all folders that are not hidden. in Windows, I have the same problem. I need Standard Folders or regular unhidden and not system folders.</p>
  
  <p>this is my entire code : </p>
  
  <pre><code>const child = require('child_process');
  var fs = require('fs');
  const os = require('os');
  
  const currentPlatform = () =&gt; {
    if ('darwin' === os.platform()) {
      return 'MAC';
    } else {
      return 'WIN';
    }
  };
  
  const getDriveList = (data, emitter) =&gt; {
    const thisPlatform = currentPlatform();
    if (thisPlatform === 'WIN') {
      child.exec('wmic logicaldisk get name', (error, stdout) =&gt; {
        let winDriveList = stdout
          .split('\r\r\n')
          .filter(value =&gt; /[A-Za-z]:/.test(value))
          .map(value =&gt; value.trim());
        emitter('getDriveList', winDriveList);
      });
    } else {
      fs.readdir('/Volumes', (err, files) =&gt; {
        emitter('getDriveList', files);
      });
    }
  };
  
  const getFilesList = (path, emitter) =&gt; {
    console.log("this was sent from client ===&gt;&gt; ", path);
    fs.readdir(path, (err, files) =&gt; {
      emitter('getFileList', files);
    });
  };
  </code></pre>