Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

url-image-size

junehay724MIT0.2.0TypeScript support: included

Get URL(ex. s3, cloudfront...) image size

image-size, url-image-size

readme

url-image-size

Supports all the image formats supported by image-size:

  • BMP
  • CUR
  • GIF
  • ICO
  • JPEG
  • PNG
  • PSD
  • TIFF
  • WebP
  • SVG
  • DDS

How to use

npm install url-image-size

or

yarn add image-size

Asynchronous

import getImageSize from 'url-image-size';
const imageSize = await getImageSize('https://nodejs.org/static/legacy/images/logo.png');
console.log(imageSize);

Result:

{ height: 66, width: 245, type: 'png'}