title: How to check an image dimensions using js or node
body: <p>So I have a <code>sample.jpg</code> file and I want to check its dimensions.</p>
  <p>The desired logic goes like this:</p>
  <pre><code>var img = require('./sample.jpg');
  console.log(typeof img) // returns string -&gt; Image
  console.log(img.height) // returns number -&gt; 300
  console.log(img.width)  // returns nubmer -&gt; 250
  </code></pre>
  <p>Never mind the return of the <code>typeof</code>. I just wan't to get the dimensions. But that is the simple break down of what where I am going. Is there a way to do this using node or plain js?</p>