promised-url-exists

1.0.7 • Public • Published

promised-url-exists

A simple node library to determine if an url exists, now with native promises. Forked from this

Usage

var urlExists = require('promised-url-exists');
 
urlExists('https://www.google.com')
  .then(({exists}) => {
    console.log(exists); // true
  })
  .catch(error => {
    console.log(error);
  });
 
urlExists('https://www.fakeurl.notreal')
  .then(({exists}) => {
    console.log(exists); // false
  })
  .catch(error => {
    console.log(error);
  });

Readme

Keywords

Package Sidebar

Install

npm i promised-url-exists

Weekly Downloads

3

Version

1.0.7

License

MIT

Last publish

Collaborators

  • psomialbert