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

is-image Build Status

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

const isImage = require('is-image');

isImage('source/unicorn.png');
//=> true

isImage('source/unicorn.txt');
//=> false

Related

License

MIT © Sindre Sorhus

Current Tags

  • 3.0.0                                ...           latest (7 years ago)

4 Versions

  • 3.0.0                                ...           7 years ago
  • 2.0.0                                ...           9 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (3)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |