How do I check to see if a URL exists without pulling it down? I use the following code, but it downloads the whole file. I just need to check that it exists.
ap
I see in your code that you are already using the request library, so just:
request
const request = require('request'); request.head('http://...', (error, res) => { const exists = !error && res.statusCode === 200; });