Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@tiagonapoli/http-timer-shim

tiagonapoli1290.0.1TypeScript support: included

Add timers to your http(s) requests

readme

@tiagonapoli/http-timer-shim

Version

This simple package was built on top of @szmarczak/http-timer.

Unfortunately, axios, unlike got, doesn't have request timings. I'm stuck with axios in some projects, so I did this shim wrapping http(s) request method and adding timers to them.

Install

$ yarn add @tiagonapoli/http-timers-shim

Usage

On your application entrypoint add the following (before every import):

import "@tiagonapoli/http-timer-shim"

This package also reexport typings from @szmarczak/http-timer:

  • ClientRequestWithTimings
  • IncomingMessageWithTimings

This way you can cast http's ClientRequest and IncomingMessage.