Detects image dimensions via request instead of Node.js native
https, allowing for options and following redirects by default. It reduces network traffic by aborting requests as soon as image-size is able to obtain the image size.
Since version 2.0.0 it returns an ES6 native
Promise that resolves with the
size object or rejects with an
Error. Requires Node.js v4+.
If you prefer using a callback, please use version 1.3.0 instead (docs)
Supports all the image formats supported by image-size:
const requestImageSize = ;;
width: 245 height: 66 type: 'png' downloaded: 856
Specifying a request
options object (docs):
const requestImageSize = ;const options =url: ''headers:'User-Agent': 'request-image-size';;
Copyright (c) 2017 Rodrigo Fernández Romero
Licensed under the MIT license.
Based on http-image-size from Johannes J. Schmidt.