res-time

1.0.1 • Public • Published

res-time NPM version NPM downloads Build Status

Get TCP/socket response time.

Install

$ npm install --save res-time

Usage

const resTime = require('res-time')
 
resTime({host: '184.87.100.246'})
  .then(time => {
    console.log(time)
    //=> 35.231842 (in millisecond)
  })
  .catch(err => {
    console.log(err.message)
  })

API

resTime([options])

options

host

Type: string
Default: localhost

The host to connect.

port

Type: number
Default: 80

Host port.

timeout

Type: number
Default: 0

Connection timeout.

License

MIT © EGOIST

Readme

Keywords

Package Sidebar

Install

npm i res-time

Weekly Downloads

2

Version

1.0.1

License

MIT

Last publish

Collaborators

  • kchan