is-an-image-url
v1.0.4
Published
This package was originally created as an async replacement for is-image-url. I was using that one but my sync security scanner said there was issue with one of the dependencies. I posted a pull request but a new version never got published, so onward a
Downloads
12
Readme
is-an-image-url
Does an async checks to see if a url is an image url.
Minor note: This package was originally created as an async replacement for is-image-url. I was using that one but my snyk security scanner said there was issue with one of the dependencies. I posted a pull request but a new version never got published, so onward and upward. The other lib was synchronous, I figured I'd make an async version.
Installation
Installation is easiest through npm:
npm install is-an-image-url --save
Usage
is-an-image-url can be included as a reference.
var isAnImageUrl = require('is-an-image-url');
isAnImageUrl(url, function(isAnImageResult){
if(isAnImageResult){
console.log("yes the url was an image");
}else {
console.log("no, the url was not an image");
}
});
CLI
$ npm install --global is-an-image-url
$ is-an-image-url --help
Usage
$ is-an-image-url "<url>"
Example
$ is-an-image-url "http://www.google.com"
The isAnImageUrl package will use the callback function with the following signature callback(isAnImageResult).
isAnImageResult
will be a bool, true if the url is for an image and false otherwise.
License
MIT © Mark Rogers