is-image
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

is-image

Check if a file path is an image

It just checks the extension. Use image-type if you want to check the actual file.

Install

npm install is-image

Usage

import isImage from 'is-image';

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

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

Related

Package Sidebar

Install

npm i is-image

Weekly Downloads

22,482

Version

4.0.0

License

MIT

Unpacked Size

3.97 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus