1.0.0-3 • Published 5 years ago

@aulamejor/size-of v1.0.0-3

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
5 years ago

size-of

A Node module to get dimensions of any image file

Supported formats

  • GIF
  • JPEG
  • PNG
  • SVG

Usage

npm install @aulamejor/size-of --save
var sizeOf = require("@aulamejor/size-of");
try {
  const dimensions = await sizeOf("images/funny-cats.png");
  console.log(dimensions.width, dimensions.height);
} catch (err) {
  console.error(err);
}

Using a URL

const sizeOf = require("@aulamejor/size-of");
const url = "http://my-amazing-website.com/image.jpeg";
const dimensions = await sizeOf(url);
console.log(dimensions.width, dimensions.height);