Skip to content

theomjones/live-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
    }
}

About

Simply checks whether a url is live.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published