Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/evgenyatlas/get-server-response-time
https://github.com/evgenyatlas/get-server-response-time
ecmascript javascript nodejs promise
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/evgenyatlas/get-server-response-time
- Owner: evgenyatlas
- Created: 2018-07-27T14:19:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-14T20:50:31.000Z (over 6 years ago)
- Last Synced: 2024-11-06T03:08:17.627Z (2 months ago)
- Topics: ecmascript, javascript, nodejs, promise
- Language: JavaScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# get-server-response-time [![NPM version](https://badge.fury.io/js/get-server-response-time.svg)](https://npmjs.org/package/get-server-response-time)
> Module for checking the response time of the server for node.js and browser
## Installation
```sh
$ npm install --save get-server-response-time
```## Usage
#### for the node.js/server
```js
const getServerResponseTime = require('get-server-response-time')
```
#### for the browser/client
```js
const getServerResponseTime = require('get-server-response-time/client')
```#### Example
```js
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](https://github.com/jeckyhit)