🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

is-image

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-image

Check if a file path is an image

latest
Source
npmnpm
Version
4.0.0
Version published
Weekly downloads
29K
2.42%
Maintainers
1
Weekly downloads
 
Created
Source

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
  • image-extensions - List of image extensions
  • image-type - Detect the image type of a Buffer/Uint8Array
  • is-text-path - Check if a filepath is a text file
  • is-binary-path - Check if a filepath is a binary file

Keywords

extension

FAQs

Package last updated on 25 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts