/ student-intifada / node_modules / image-meta /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]dist/a year ago -  
[   ]LICENSEa year ago1.2K 
[TXT]README.mda year ago1.8K595aea1 more query options + view options [كارل مبارك]
[   ]package.jsona year ago1.3Kafd0ccc remove unused [كارل مبارك]
README.md

image-meta

npm version npm downloads bundle Codecov

Detect image type and size using pure javascript.

Usage

Install package:

# npm
npm install image-meta

# yarn
yarn add image-meta

# pnpm
pnpm install image-meta

# bun
bun install image-meta
import { imageMeta } from "image-meta";

const data = await fetch(url).then((res) => res.buffer());

// Meta contains { type, width?, height?, orientation? }
const meta = imageMeta(data);

Note: imageMeta throws an error if either data is not a Buffer/Uint8Array, or data is invalid or type cannot be determined. You should wrap it into a try/catch statement to handle errors.

Development

License

Made with 💛

Published under MIT License.

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80