node-http-ping
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

node-http-ping

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

Installation

npm install node-http-ping --save

Usage

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'))

Readme

Keywords

Package Sidebar

Install

npm i node-http-ping

Weekly Downloads

114

Version

0.3.1

License

MIT

Unpacked Size

8.95 kB

Total Files

6

Last publish

Collaborators

  • seikho