yarn add live-url
Or...
npm install live-url --save
It just takes one parameter, the url. You must provide a protocol, (https / http).
const liveUrl = require('live-url');
liveUrl('https://bbc.co.uk')
.then(res => {
// is live
})
.catch(e => {
// is not live
})
async function (url) {
try {
const res = await liveUrl(url)
// URL is live
} catch (e) {
// URL is not live
}
}