Passes back all URLs which respond with status code 200.
npm install find-reachable-urlsPasses back all URLs which respond with status code 200.
``sh`
npm install find-reachable-urls --save
`js
const findReachableUrls = require('find-reachable-urls')
const urls = [
'https://google.com', // 200
'https://github.com/nonexistent-url', // 404
'https://github.com/OctoLinker/chrome-extension', // 301
]
findReachableUrls(urls)
.then(function(result) {
console.log(result)
// ['https://google.com', 'https://github.com/OctoLinker/chrome-extension']
})
.catch(function(err) {
// handle error
})
`
Returns a Promise with all reachable urls.
#### urls
Type: string, array
The URL(s) to check.
#### options
Type: object
##### firstMatch
Type: boolean
Default: false
If true it returns the first reachable url and stops any further requests. If none of the urls is reachable it returns undefined.
`sh``
npm install
npm test
- heads: Make parallel HEAD requests for an array of URLs and get back their HTTP status codes.
MIT