
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.
simple-request-caching
Advanced tools
A very simple caching approach for requests.
There are no external dependencies for the code, so feel free to copy+paste it into whatever framework you are using (e.g., here's an Angular example). Otherwise, install using:
npm install simple-request-caching
The basic setup is this:
var CachedRequest = require('simple-request-caching')
var request = new CachedRequest({
cacheMillis: 500, // the millis that the request is cached, or -1 for forever
request: function(params) {
return http.get('/url/path', params)
}
})
Set a single one of those up for any request you want to cache, then use it like:
request({ key: 'value' }).then(function(data) {
// the response from the http.get(), as a promise
})
When you make a new CachedRequest, it has the following parameters:
cacheMillis (required): The number of milliseconds to cache the request
response. Use -1 to cache things forever.request (required): The function called when a request is not cached. Must
return a promise. Rejected promises are not cached.stringify (optional): A function that is called to stringify the request
parameters. If unspecified, a default is used which will stringify flat
object correctly and efficiently. If you have deeper objects, you'll want
to implement your own stringify function.FAQs
A very simple caching approach for requests.
We found that simple-request-caching demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.