0.1.2 • Published 6 years ago

live-url v0.1.2

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

Simply checks whether a url is live or not.

Installation

yarn add live-url

Or...

npm install live-url --save

Usage

It just takes one parameter, the url. You must provide a protocol, (https / http).

Promises

const liveUrl = require('live-url');

liveUrl('https://bbc.co.uk')
    .then(res => {
        // is live
    })
    .catch(e => {
        // is not live
    })

Async/Await

async function (url) {
    try {
        const res = await liveUrl(url)
        // URL is live
    } catch (e) {
        // URL is not live
    }
}
0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago