# is-image

> Check if a file path is an image

Latest version **4.0.0** (published 2023-07-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-image
pnpm add is-image
yarn add is-image
bun add is-image
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2023-07-25 |
| First published | 2015-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=16 |
| Dependencies | 0 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 99 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | extension, extensions, file, path, check, detect, is, image, img, photo, picture, jpg, jpeg, png |

## Links

- npm: https://www.npmjs.com/package/is-image
- Repository: https://github.com/sindresorhus/is-image
- Homepage: https://github.com/sindresorhus/is-image#readme
- Issues: https://github.com/sindresorhus/is-image/issues
- npm.io page: https://npm.io/package/is-image

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2023-07-25
- 3.1.0 — 2022-07-06
- 3.0.0 — 2019-04-19
- 2.0.0 — 2017-07-07
- 1.0.1 — 2015-05-25
- 1.0.0 — 2015-05-17

## README

# is-image

> Check if a file path is an image

It just checks the extension. Use [`image-type`](https://github.com/sindresorhus/image-type) if you want to check the actual file.

## Install

```sh
npm install is-image
```

## Usage

```js
import isImage from 'is-image';

isImage('source/unicorn.png');
//=> true

isImage('source/unicorn.txt');
//=> false
```

## Related

- [image-extensions](https://github.com/arthurvr/image-extensions) - List of image extensions
- [image-type](https://github.com/sindresorhus/image-type) - Detect the image type of a Buffer/Uint8Array
- [is-text-path](https://github.com/sindresorhus/is-text-path) - Check if a filepath is a text file
- [is-binary-path](https://github.com/sindresorhus/is-binary-path) - Check if a filepath is a binary file

---
_Source: https://npm.io/package/is-image · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
