title: Detecting file type from buffer in node js?
body: <p>I have created a buffer from a file which can be pdf, jpg or any other format. Now I want to detect if the buffer is of the pdf file or any other file. </p>
  
  <pre><code>request({ url, encoding: null }, (err, resp, buffer) =&gt; {
      hashFromFilebuffer('sha256', buffer).then(function (result) {
          console.log(result)
      }).catch(function (error) {
          console.log(error)
      });
  });
  </code></pre>