
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
axios-status
Advanced tools
This package can be used to trace status of all Axios requests for the purpose of application-wide progress indicator
npm install axios-status --save
First, create a new instance of AxiosStatus, and register your axios instances with it. You can provide following options to constructor
const axiosStatus = new AxiosStatus({
timeout: 20, // default 10
autoRetry: true // default false
})
axiosStatus.register(axios)
axiosStatus.register(mySpecialAxiosInstance)
The autoRetry
options specifies if axiosStatus
should auto retry all failed requests after given timeout
(seconds)
Then, you can subscribe on AxiosStatus
events to be able to show them in UI.
busy
event has values of true / false
and signals that there are XHR requests in progressoffline
event has values of true / false
and signals that request failed because network is temporariy downtimer
event emits a number that signals seconds to next auto-retryaxiosStatus.on('busy', (val) => this.loadingProgress = val)
axiosStatus.on('offline', (val) => this.disconnected = val)
axiosStatus.on('timer', (val) => this.secondsToReconnect = val)
To be able to correctly run a callback on auto-retry, you need to use axiosStatus.request
. It supports all axios request options, plus success
callback, error
callback, and instance
to specify axios instance on which this request should be run.
axiosStatus.request({
instance: mySpecialAxiosInstance,
method: 'get',
url: API_URL + '/me',
success: (res) => {
this.user = res.data
},
error: (err) => {
throw err
}
})
To retry manually, you can just call axiosStatus.retry()
to retry all calls initiated when offline
FAQs
Network requests status tracking for Axios
The npm package axios-status receives a total of 5 weekly downloads. As such, axios-status popularity was classified as not popular.
We found that axios-status demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.