</>PackageGraphPackageGraph

image-size

npmv2.0.2TypeScript

get dimensions of any image file

Adopt with care

image-size is usable, with caveats. Last published 525 days ago. 6 releases in the last 2 years.

  • ?Adoption: grade ?, Not reported by this registry.

    No download data reported for this package yet.

  • CMaintenance: grade C, Fair — worth a look.

    Last published 525 days ago. 6 releases in the last 2 years.

  • AWeight: grade A, Excellent.

    Zero runtime dependencies, about 370 KB installed.

  • BSupply chain: grade B, Good.

    This package has a single maintainer (bus factor of 1).

  • ALicense: grade A, Excellent.

    MIT — permissive, with no copyleft found in the dependency tree.

Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.

Install cost

What you actually take on by adding image-size to a project.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

370 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

Longest resolved dependency chain below this package.

Compatibility

Node.js
node >=16.x
Module format
ESM + CommonJS
TypeScript
Types included
Install scripts
None

Quick start

A usage example from the image-size README.

javascriptFull README ↗
import { imageSize } from 'image-size'
// or
const { imageSize } = require('image-size')

const dimensions = imageSize(buffer)
console.log(dimensions.width, dimensions.height)

image-size vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
image-sizethis page01MIT1 year ago
buffer-image-size01MIT1 day ago
get-east-asian-width69.3M1MIT1 day ago
string-width03MIT1 day ago
@blazediff/core01MIT1 day ago
d3-shape02ISC1 day ago

Dependencies

Declared by image-size v2.0.2. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (9)

@biomejs/biome 1.9.4@types/glob 8.1.0@types/node 18.19.39c8 10.1.3glob 10.4.2ts-node 10.9.2tsup 8.3.5typedoc 0.25.13typescript 5.4.5

Used by

Popular packages that depend on image-size.

Relationship graph

Dependencies (left) and dependents (right) of image-size.

metroimage-size
image-size dependencies dependents

Frequently installed together

Release history

6 releases in the last two years, typically about 16 days apart.

Recent versions of image-size
VersionPublishedSizeLicense
1.2.11 year ago55 KBMIT
2.0.2latest1 year ago370 KBMIT
2.0.11 year ago370 KBMIT
2.0.01 year ago369 KBMIT
2.0.0-beta.41 year ago369 KBMIT
1.2.01 year ago55 KBMIT
2.0.0-beta.22 years ago78 KBMIT
1.1.12 years ago49 KBMIT
1.1.02 years ago49 KBMIT
2.0.0-beta.12 years ago83 KBMIT
2.0.0-beta2 years ago83 KBMIT
2.0.0-alpha.22 years ago81 KBMIT
2.0.0-alpha.13 years ago80 KBMIT
1.0.24 years ago44 KBMIT
1.0.14 years ago44 KBMIT

Overview

image-size is an npm package that get dimensions of any image file. It has 1 known dependents in the graph. The latest version is 2.0.2, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need get dimensions of any image file and value a focused solution.

When not to use it

Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.

Pros

  • Ships TypeScript type definitions.
  • Clear open-source license (MIT).

Cons

  • No significant drawbacks detected from available metadata.

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Keywords

Frequently asked questions

Should I use image-size?

image-size is usable, with caveats. Last published 525 days ago. 6 releases in the last 2 years.

How do I install image-size?

Run `npm install image-size` to add image-size to your npm project.

What license is image-size released under?

image-size is distributed under the MIT license.

How popular is image-size?

npm does not publish download counts. Within PackageGraph's crawl, 1 known packages depend on image-size.

Is image-size still maintained?

The most recent release of image-size (v2.0.2) was published 1 year ago.

Does image-size run install scripts?

No. image-size does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.