@buxlabs/is-image

Check if a filepath is an image

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
00Jan 12, 2018Jan 9, 2018Minified + gzip package size for @buxlabs/is-image in KB

Readme

is-image

Check if a filepath is an image

The package is very similar to image-type but it does not depend on built in path and does not use const or Set. It makes it simpler to use it in older browsers without a transpilation step. It does not handle all of the edge cases as path.extname does though.

Install

$ npm install @buxlabs/is-image

Usage

var isImage = require('@buxlabs/is-image');

isImage('src/foo.png'); // true
isImage('src/foo.txt'); // false

Related

License

MIT

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.