Registry / devops / axios-timed

axios-timed

JSON →
library1.0.0jsnpmunverified

axios-timed is a lightweight wrapper around axios that adds request timing capabilities, logging elapsed time for HTTP requests in milliseconds. Current stable version is 1.0.0. It provides a simple interceptor-based approach to measure and log request duration. Compared to manual timing, it integrates seamlessly with axios instances and supports custom logging functions. Release cadence is low; last update was several years ago.

npm install axios-timed
INSTALL
IMPORT
SIG · AXIOS-TIMED
A
axios-timed
devopsjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

axiosTimed
import axiosTimed from 'axios-timed'
const axiosTimed = require('axios-timed')
Package uses CommonJS default export; ESM import via default import works as it compiles to CJS. No named exports.
applyTiming
import { applyTiming } from 'axios-timed'
applyTiming is exported as a named function. Use this to apply timing to an existing axios instance.

Shows how to apply timing to an axios instance with custom logging function, then make a request.

import axios from 'axios'; import axiosTimed from 'axios-timed'; const api = axios.create({ baseURL: 'https://api.example.com' }); axiosTimed(api, { log: (duration, config) => console.log(`Request to ${config.url} took ${duration}ms`) }); async function fetchData() { try { const response = await api.get('/data'); console.log('Data:', response.data); } catch (error) { console.error('Error:', error); } } fetchData();
Debug
Known issues
breakingThe 'config' object passed to the log function does not contain the full axios config in versions <1.0.0.
fix
Upgrade to 1.0.0 or access config properties via the second parameter.
affects: <1.0.0
deprecatedThe 'log' option's signature changed in v1.0.0; previously it was (config, duration).
fix
Update log function signature to (duration, config).
affects: <1.0.0
Errors
Common errors & fixes
TypeError: axiosTimed is not a function
Using ESM import incorrectly; the package may be required differently.
fix
Use default import: import axiosTimed from 'axios-timed'
axiosTimed is not a function
When using CommonJS require without default property.
fix
Use const axiosTimed = require('axios-timed').default or import default.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
axiosrequiredpeer dependency to provide HTTP client functionality
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources