superagent-response-time

A plugin for superagent that outputs a requests response time in milliseconds.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
superagent-response-time
301.0.36 years ago6 years agoMinified + gzip package size for superagent-response-time in KB

Readme

superagent-response-time
A plugin for superagent that outputs a requests response time in milliseconds.

Installation

Install with npm:
$ npm i superagent-response-time

Usage

import request from 'superagent';
import responseTime from 'superagent-response-time';

const callback = (req, time) => {
  console.log(time); //180.25
}

request
  .get('/some-url')
  .use(responseTime(callback)) //Add the plugin to the request
  .end(function(err, res){
    // Do something
  });