Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@nuskin/axios-util
Advanced tools
axios-util
enables you to utilize Axios as you normally would. By default, axios-util
sets
the timeout to 10000ms.
Retry functionality is implemented using the axios-retry module. Utilize getRetryAxiosInstance()
to obtain an Axios instance with retry capabilities. All default settings of axios-retry
are applied, except for the retryDelay, which is set to axiosRetry.exponentialDelay. You can customize the retry behavior by supplying an axios-retry
options object to getRetryAxiosInstance()
.
Using npm:
npm install @nuskin/axios-util
Using yarn:
yarn add @nuskin/axios-util
For ESM syntax, use import
:
import { axios, getRetryAxiosInstance } from '@nuskin/axios-util'
For CommonJS, use require
:
const { axios, getRetryAxiosInstance } = require('@nuskin/axios-util')
To customize the retry logic, access axios-retry
with ESM import syntax:
let retryDelay = process.env.AXIOS_RETRY_DELAY || 5000
const myAxiosWithRetry = getRetryAxiosInstance({
retries: 3,
shouldResetTimeout: true,
retryDelay: (retryCount) => {
return retryCount * retryDelay
},
retryCondition: (error) => {
// If retry condition is not specified, by default, idempotent requests are retried
return error.response?.status >= 500 || error.code === 'ECONNABORTED'
},
onRetry: (retryCount, error, requestConfig) => {
console.log(
{
retryCount,
message: error.message,
statusCode: error.response?.status,
statusText: error.response?.statusText,
responseData: error.response?.data
},
requestConfig.metric
)
return true;
}
})
FAQs
An Axios utility ...
The npm package @nuskin/axios-util receives a total of 1,165 weekly downloads. As such, @nuskin/axios-util popularity was classified as popular.
We found that @nuskin/axios-util demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.