Registry / testing / axios-api-profiler

axios-api-profiler

JSON →
library1.1.2jsnpmunverified

Axios interceptor that profiles HTTP responses for timing information, including network time and axios handling time. Version 1.1.2 (stable, last release in 2019) supports Node >=8 and browsers. Key differentiators: simple integration via interceptor, configurable per-call or instance-level profiling, ability to retrieve all profiling data via defaultApiProfilerInstance. Minimal dependencies (only requires axios). Provides console.log output by default but can be suppressed.

npm install axios-api-profiler
INSTALL
IMPORT
SIG · AXIOS-API-PROFILER
A
axios-api-profiler
testingjavascriptv1.1.2
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.

default (axiosRequestProfiler)
import axiosRequestProfiler from 'axios-api-profiler'
const { axiosRequestProfiler } = require('axios-api-profiler')
Default export is a function, use default import or require with .default
defaultApiProfilerInstance
import { defaultApiProfilerInstance } from 'axios-api-profiler'
import defaultApiProfilerInstance from 'axios-api-profiler'
Named export, not default
AxiosRequestProfiler (type)
import type { AxiosRequestProfiler } from 'axios-api-profiler'
import { AxiosRequestProfiler } from 'axios-api-profiler' (if used as runtime value)
TypeScript type export; only use in type positions

Demonstrates importing the default profiler, attaching it to axios, and making a GET request with timing logs.

import axios from 'axios'; import axiosRequestProfiler from 'axios-api-profiler'; axiosRequestProfiler(axios); axios.get('https://jsonplaceholder.typicode.com/posts/1') .then(response => { console.log('Data:', response.data); }) .catch(error => { console.error('Error:', error.message); });
Debug
Known issues
breakingLibrary requires axios as peer dependency; ensure axios is installed in your project.
fix
Run 'npm install axios' if not already present.
affects: >=1.0.0
gotchadefaultApiProfilerInstance is a module-level singleton; multiple imports share the same instance.
fix
Use the same instance throughout your app or avoid relying on isolated state.
affects: >=0.0.1
deprecatedignoreApiProfiling and ignoreApiProfilingLogs are configured via axios config, but named inconsistently with other axios options.
fix
Use exact strings: 'ignoreApiProfiling' and 'ignoreApiProfilingLogs' as config keys.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'axios-api-profiler'
Missing npm install or incorrect package name (typo).
fix
Run 'npm install axios-api-profiler' or check spelling.
axiosRequestProfiler is not a function
Importing library as named export instead of default.
fix
Use 'import axiosRequestProfiler from 'axios-api-profiler'' (default import).
defaultApiProfilerInstance is undefined
Using default import instead of named import.
fix
Change to 'import { defaultApiProfilerInstance } from 'axios-api-profiler'.
Upgrade
Version history
1.1.2latest on npm
Audit
Dependencies
axiosrequiredpeer dependency for intercepting HTTP requests
Agent activity
24 hits · last 30 days
node
20
Amazon
1
OpenAI (training)
1
Resources
axios-api-profiler — npm install axios-api-profiler · libregistry