find-reachable-urls
Passes back all URLs which respond with status code 200.
Installation
npm install find-reachable-urls --save
Usage
const findReachableUrls = require('find-reachable-urls')
const urls = [
'https://google.com',
'https://github.com/nonexistent-url',
'https://github.com/OctoLinker/chrome-extension',
]
findReachableUrls(urls)
.then(function(reachableUrls) {
console.log(reachableUrls)
})
.catch(function(err) {
})
Node-style callbacks are supported too:
findReachableUrls(urls, function(err, reachableUrls) { })
If you just need to look up one URL, pass it as an argument instead of an array:
findReachableUrls('http://mysite.com').then(...)
Tests
npm install
npm test
Related
- heads: Make parallel HEAD requests for an array of URLs and get back their HTTP status codes.
License
MIT