$ npm install browser-image-size
To use browser-image-size you must polyfill Promise.
var browserImageSize = require('browser-image-size')
browserImageSize('128.png')
.then(function (size) {
console.log(size)
// => {height: 128, width: 128}
})
Parameters:
- image : {(File|blob|string)} File, blob, or URL string
Returns:
- BrowserImageSizePromise : {Promise} resolved with object containing image width and height
$ npm test -- --local
MIT