is-image

Check if a file path is an image

MIT 6 个版本
安装
npm install is-image
yarn add is-image
pnpm add is-image
bun add is-image
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
版本列表
4.0.0 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