Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

is-image

sindresorhus130kMIT4.0.0TypeScript support: included

Check if a file path is an image

extension, extensions, file, path, check, detect, is, image, img, photo, picture, jpg, jpeg, png

readme

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