Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

axios-timing

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-timing - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "axios-timing",
"version": "1.0.0",
"version": "1.0.1",
"description": "Axios plugin to measure the actual time it takes for a request to complete",

@@ -5,0 +5,0 @@ "main": "index.js",

# axios-timing
Axios plugin to measure the actual time it takes between requests
Axios plugin to measure the actual time it takes for a request to complete
## Installation
You can install this plugin using **Yarn** or **NPM**
```bash
yarn add axios-timing
# - or -
npm install axios-timing
```
## Basic Usage
The example below will log all request times out to the console...
```js
import axios
import axiosTiming from './axios-timing'
axiosTiming(axios, console.log)
```
### Axios Instance
If you are using an axios instance, you should pass this through as the first argument
```js
import axios
import axiosTiming from './axios-timing'
const instance = axios.create()
axiosTiming(instance, console.log)
```
### Custom Callback
You can pass through a custom callback as your second arguement
```js
import axios
import axiosTiming from './axios-timing'
axiosTiming(axios, timeInMs => console.log(`${timeInMs.toFixed}ms`))
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc