1.4.0 • Published 6 years ago

is-image-url-async v1.4.0

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

is-image-url-async

Checks to see if a URL points to an image and returns a string containing the appropiate extension, or undefined if the URL does not point to an image.

npm package

Installation

npm:

npm install is-image-url-async --save

Usage

Standard promises:

const isImageUrl = require('is-image-url-async');

isImageUrl(url, timeout)
    .then(ext => console.log(ext))
    .catch(error => console.error('Error', error));

Async function:

const isImageUrl = require('is-image-url-async');

async function foo(url, timeout) {
    try {
        const ext = await isImageUrl(url, timeout);
        console.log(ext);
    }
    catch (error) {
        console.error('Error', error);
    }
}
1.4.0

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago