get-server-response-time
v1.1.5
Published
module for checking the response time of the server for node.js and browser
Downloads
3
Maintainers
Readme
get-server-response-time
Module for checking the response time of the server for node.js and browser
Installation
$ npm install --save get-server-response-time
Usage
for the node.js/server
const getServerResponseTime = require('get-server-response-time')
for the browser/client
const getServerResponseTime = require('get-server-response-time/client')
Example
var getServerResponseTime = require('get-server-response-time')
//simple call
getServerResponseTime('https://google.com')
.then(responseTime => {
console.log(responseTime)
})
//call with additional parameters
getServerResponseTime('https://google.com', {
timeout: 5000 //maximum waiting time for server response | default: 5000
responseInCaseError: true //Whether to return the response time of the server in case of an error | default: true
})
.then(responseTime => {
console.log(responseTime)
})
License
MIT © jeckyhit