Giter Club home page Giter Club logo

check-http-status's Introduction

check-http-status

NPM version Downloads Build Status

Easily check status codes, response headers, and redirect chains in Node.js similar as done from the httpstatus website.

When the site is on VPN so this is where it plays an important role. You can simply connect your system/machine with VPN and run this package locally so it can check the status of your VPN connected URL(s).

It can also check the website that are secured with HTTP Authentication.

Install

Via npm

npm install check-http-status --save-dev

Via Yarn

yarn add check-http-status --dev

Examples

Status Code of the Sitemap(s) URL(s)

const checkHttpStatus = require('check-http-status');

checkHttpStatus({
	'sitemaps':  [
    'https://www.trunkcode.com/page-sitemap.xml',
    'https://www.trunkcode.com/post-sitemap.xml'
  ],
	'skip200': true, // Do not report the URLs having HTTP code 200.
  'export': {
    'format': 'xlsx',
    'location': '/Users/trunkcode/Desktop/',
  },
  'options': {
    'auth': {
      'password': 'Testing1234',
      'username': 'trunkcode'
    },
    'headers': {
      'Accept': 'text/html',
    }
  }
});

Status Code of the particular URL(s)

const checkHttpStatus = require('check-http-status');

checkHttpStatus({
	'urls': [
    'http://trunkcode.com/',
    'https://example.com/',
    'https://example1234.com/',
    'https://www.trunkcode.com/',
    'https://www.trunkcode.com/test/'
  ],
	'skip200': true, // Do not report the URLs having HTTP code 200.
  'export': {
    'format': 'xlsx',
    'location': '/Users/trunkcode/Desktop/',
  },
  'options': {
    'auth': {
      'password': 'Testing1234',
      'username': 'trunkcode'
    },
    'headers': {
      'Accept': 'text/html',
    }
  }
});

Status Code of the Sitemap(s) URL(s) with particular URL(s)

const checkHttpStatus = require('check-http-status');

checkHttpStatus({
	'sitemaps':  [
    'https://www.trunkcode.com/page-sitemap.xml',
    'https://www.trunkcode.com/post-sitemap.xml'
  ],
	'urls': [
    'http://trunkcode.com/',
    'https://example.com/',
    'https://example1234.com/',
    'https://www.trunkcode.com/',
    'https://www.trunkcode.com/test/'
  ],
	'skip200': true, // Do not report the URLs having HTTP code 200.
  'export': {
    'format': 'xlsx',
    'location': '/Users/trunkcode/Desktop/',
  },
  'options': {
    'auth': {
      'password': 'Testing1234',
      'username': 'trunkcode'
    },
    'headers': {
      'Accept': 'text/html',
    }
  }
});

Parameters

Attributes Type Required Default Description
sitemaps Array Yes Sitemap(s) URL(s) where the Actual site URL(s) needs to be fetched for checking the HTTP Status.
urls Array Yes URL(s) for which HTTP Status needs to be checked.
skip200 Boolean No false Whether to list the HTTP status 200 URL(s) or not.
export Object No {} Whether to export the status report or not. By default it logs the report on the screen.
options Object No {} Define options like HTTP Auth credentials if the site is locked or headers etc.

NOTE: sitemaps or urls is required. You can define both parameters as well to fetch URL(s) from sitemap and the URL(s) that are not listed in the ssitemap, you can provide them separately.

check-http-status's People

Contributors

samiahmedsiddiqui avatar mcreale avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.