title: How to create a file object with a path in NodeJS?
body: <p>I want to know if it is possible to create a file object (name, size, data, ...) in NodeJS with the path of existing file ? I know that it is possible in client side but I see nothing for NodeJS.</p>
  
  <p>In others words, I want the same function works in NodeJS :</p>
  
  <pre><code>function srcToFile(src, fileName, mimeType){
      return (fetch(src)
          .then(function(res){return res.arrayBuffer();})
          .then(function(buf){return new File([buf], fileName, {type:mimeType});})
      );
  }
  
  srcToFile('/images/logo.png', 'logo.png', 'image/png')
  .then(function(file){
      console.log(file);
  });
  </code></pre>
  
  <p>And ouput will be like :</p>
  
  <pre><code>File {name: "logo.png", lastModified: 1491465000541, lastModifiedDate: Thu Apr 06 2017 09:50:00 GMT+0200 (Paris, Madrid (heure d’été)), webkitRelativePath: "", size: 49029, type:"image/png"…}
  </code></pre>