I assume that you are trying to get the image file size via http, not the image sizes. (Please correct me if I am wrong)
You can simply send a HEAD request to the resource and see the Content-Length header:
var http = require('http'); var req = http.request({ host: 'www.gravatar.com', port: 80, path: '/avatar/b9da20552a71c4d3c4c6dc2d55418cf2', method: 'HEAD' }, function(res) { console.log("Size: " + res.headers['content-length']); } ).end();
source share