Check if a url is an image
Checks asynchronously whether an image URL is valid or not with using HTTP HEAD.
$ npm install --save image-url-validator
const isImageURL = require('image-url-validator');
await isImageURL('https://via.placeholder.com/300/09f/fff.png');
//=> true
await isImageURL('https://github.com/BhanukaUOM/Image-Url-Validator');
//=> false
import isImageURL = require('image-url-validator');
await isImageURL('https://via.placeholder.com/300/09f/fff.png');
//=> true
await isImageURL('https://github.com/BhanukaUOM/Image-Url-Validator');
//=> false
- Added ES5 Support
- Initial Release
Licensed under The MIT License (MIT)