title: Node.js fs.stat [TypeError: path must be a string] on passing Buffer
body: <p>According to documentation for <strong>fs.stat</strong> <a href="https://nodejs.org/api/fs.html#fs_fs_stat_path_callback" rel="nofollow noreferrer">here</a>, <code>stat</code> function can accept a string path to a file OR a buffer.</p>
  
  <p>But when I passed a Buffer, I am getting an error:</p>
  
  <blockquote>
    <p>[TypeError: path must be a string]</p>
  </blockquote>
  
  <p>Below is the code.</p>
  
  <pre><code>exports.importNow = function (req, res) {
  try {
        fs.stat( req.files.csv.buffer, function (err, stat) {
            if( err == null ) {
                console.log(2);
                return resolve();
            } else {
                console.log(3);
                return reject( [validation_errors.FILE_DOES_NOT_EXIST, err] );
            }
        });
  
      } catch ( err ) {
        console.log(5);
        console.log(err);
        return reject( [validation_errors.FILE_DOES_NOT_EXIST, err] );
      }
  }
  </code></pre>
  
  <p>Cann anybody please help me find the reason? Or am I missing anything?
  Thank you.</p>