is-image
Check if a file path is an image
Last updated 3 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install is-image 
SYNC missed versions from official npm registry.

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

Current Tags

  • 4.0.0                                ...           latest (3 years ago)

6 Versions

  • 4.0.0                                ...           3 years ago
  • 3.1.0                                ...           4 years ago
  • 3.0.0                                ...           8 years ago
  • 2.0.0                                ...           9 years ago
  • 1.0.1                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 19
Today 0
This Week 0
This Month 7
Last Day 0
Last Week 5
Last Month 9
Dependencies (0)
None
Dev Dependencies (3)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE