request spy

logo"

Spy on outgoing requests in node. Reports errors, host, path, method, statusCode and request time. Useful for logging, metrics, debugging etc.

npm install request-spy

Usage

const requestSpy = require('request-spy');

// Spy on all outgoing request
requestSpy.spy((error, requestData) => {
  console.log(error); // Socket errors
  console.log(requestData);
});


// Restore
requestSpy.restore();

requestData includes the following properties:

MIT License © 2017 Daniel Lundin (http://twitter.com/danielundin).