
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
vmo-request
Advanced tools
VmoRequest is a request utility class based on Axios, designed to provide features such as caching, state management, and configuration merging. It is particularly suitable for scenarios where the same requests need to be frequently made in an application, as the caching mechanism can effectively reduce server load and improve application performance.
mergeDeepRight method to prevent configuration overriding issues.npm install axios ramda md5
import VmoRequest from './VmoRequest'
import axios from 'axios'
const vmoRequest = new VmoRequest({
baseURL: 'https://api.example.com',
headers: {
'Content-Type': 'application/json'
}
})
async function fetchData() {
try {
const response = await vmoRequest.request(
{
url: '/data',
method: 'get'
},
1000 * 2, // Cache for 2 seconds
3 // Retry 3 times, total 4 requests
)
console.log(response.data)
} catch (error) {
console.error(error)
}
}
fetchData() // Initiate the request
fetchData() // Enter the waiting queue
fetchData() // Enter the waiting queue
fetchData() // Enter the waiting queue
setTimeout(() => {
fetchData() // Enter the waiting queue or directly get the cached result if the data has been returned
}, 1000 * 1)
// In the end, only one request will be truly initiated. If it fails, it will retry 3 times. When the result is finally returned, it will be distributed to subsequent requests.
setTimeout(() => {
fetchData() // The cache will expire and a new request will be initiated
}, 1000 * 10)
VmoRequest Class Constructor
const vmoRequest = new VmoRequest({
baseURL: 'https://api.example.com',
headers: {
'Content-Type': 'application/json'
}
})
console.log(!!vmRequest.instance) // false
// Build mode for generating instances
const vmoRequest = new VmoRequest(
{
baseURL: 'https://api.example.com',
headers: {
'Content-Type': 'application/json'
}
},
true
)
console.log(!!vmRequest.instance) // true
vmoRequest.instance // The created axios instance
getDefaultConfig Method
vmoRequest.getDefaultConfig() // Partial<AxiosRequestConfig>
setDefaultConfig Method
vmoRequest.setDefaultConfig(config: Partial<AxiosRequestConfig>): boolean
request Method
vmoRequest.request(config: Partial<AxiosRequestConfig>, expiredTime: number = 0, retryTimes:number=0): Promise<any>
FAQs
axios request http https
We found that vmo-request demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.