find-reachable-urls
Passes back all URLs which respond with status code 200.
Installation
npm install find-reachable-urls --save
Usage
const findReachableUrls = const urls = 'https://google.com' // 200 'https://github.com/nonexistent-url' // 404 'https://github.com/OctoLinker/chrome-extension' // 301
findReachableUrls(urls, [options], [callback])
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
.
Tests
npm installnpm test
Related
- heads: Make parallel HEAD requests for an array of URLs and get back their HTTP status codes.
License
MIT