image-size
npmv2.0.2TypeScriptget 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.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
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.
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.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| image-sizethis page | 0 | 1 | MIT | 1 year ago |
| buffer-image-size | 0 | 1 | MIT | 1 day ago |
| get-east-asian-width | 69.3M | 1 | MIT | 1 day ago |
| string-width | 0 | 3 | MIT | 1 day ago |
| @blazediff/core | 0 | 1 | MIT | 1 day ago |
| d3-shape | 0 | 2 | ISC | 1 day ago |
Dependencies
Declared by image-size v2.0.2. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (9)
Used by
Popular packages that depend on image-size.
Relationship graph
Dependencies (left) and dependents (right) of image-size.
Frequently installed together
The ultimate javascript content-type utility.
A JavaScript parser built from the Hermes engine
🚇 Metro's core package.
Utility functions for converting to and from URLs that encode query string data into URL paths
Module for executing heavy tasks under forked processes in parallel, by providing a `Promise` based interface, minimum overhead, and bound workers.
Babel Types is a Lodash-esque utility library for AST nodes
Lightweight debugging utility for Node.js and the browser
Get details about the current Continuous Integration environment
A drop-in replacement for fs, making various improvements.
yargs the modern, pirate-themed, successor to optimist.
TypeScript definitions for ws
No description provided.
Release history
6 releases in the last two years, typically about 16 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 1.2.1 | 1 year ago | 55 KB | MIT |
| 2.0.2latest | 1 year ago | 370 KB | MIT |
| 2.0.1 | 1 year ago | 370 KB | MIT |
| 2.0.0 | 1 year ago | 369 KB | MIT |
| 2.0.0-beta.4 | 1 year ago | 369 KB | MIT |
| 1.2.0 | 1 year ago | 55 KB | MIT |
| 2.0.0-beta.2 | 2 years ago | 78 KB | MIT |
| 1.1.1 | 2 years ago | 49 KB | MIT |
| 1.1.0 | 2 years ago | 49 KB | MIT |
| 2.0.0-beta.1 | 2 years ago | 83 KB | MIT |
| 2.0.0-beta | 2 years ago | 83 KB | MIT |
| 2.0.0-alpha.2 | 2 years ago | 81 KB | MIT |
| 2.0.0-alpha.1 | 3 years ago | 80 KB | MIT |
| 1.0.2 | 4 years ago | 44 KB | MIT |
| 1.0.1 | 4 years ago | 44 KB | MIT |
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
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.