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

2.0.1 • 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

License

MIT © Sindre Sorhus

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i is-image-web

    Weekly Downloads

    1

    Version

    2.0.1

    License

    MIT

    Unpacked Size

    4.09 kB

    Total Files

    5

    Last publish

    Collaborators

    • bobbyg603