
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.
singleflight
Advanced tools
Singleflight allows you to simply wrap asynchronous functions of the form
function(key, callback)
where key is a single string argument and callback
can be a function of any signature.
var singleflight = require('singleflight');
var request = require('request');
var wrappedget = singleflight(request.get);
wrappedget('https://www.example.com/cool.jpg', function(error, response) {
...
});
wrappedget('https://www.example.com/cool.jpg', function(error, response) {
...
});
will result in only one call to fetch https://www.example.com/cool.jpg
.
Useful applications include re-validation and re-population of caches, and any other de-duplication of longish running asynchronous tasks. Combines well with other async flow control tools like Promises and the async and vasync libraries.
npm test
FAQs
A wrapper for de-duplicating asynchronous requests
We found that singleflight 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.