Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/seikho/node-http-ping

A simple website pinger for node
https://github.com/seikho/node-http-ping

Last synced: 5 days ago
JSON representation

A simple website pinger for node

Awesome Lists containing this project

README

        

# node-http-ping

A simple, light-weight JavaScript module for pinging HTTP services

### Installation

```
npm install node-http-ping --save
```

### Usage

```javascript
import ping from 'node-http-ping'
// or
const ping = require('node-http-ping')

// Using http by default
ping('google.com', 80 /* optional */)
.then(time => console.log(`Response time: ${time}ms`))
.catch(() => console.log(`Failed to ping google.com`))

// Or use https
ping('https://google.com')
.then(time => console.log(`Response time: ${time}ms`))
.catch(() => console.log('Failed to ping google.com'))
```