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.
co-foreach
Advanced tools
Run generator function as forEach loop callback
npm install co-foreach
var forEach = require('co-foreach');
// Every generator callback is wrapped into co function,
// so you can take advantage of all co features
forEach(array, function * (item, idx) {
// do something awesome with generators
}).then(handleFinish);
var forEach = require('co-foreach');
var Q = require('q');
var fs = require('fs');
var files = ['./test/test1.txt', './test/test2.txt'];
// co-foreach is returning promise
forEach(files, function * (file, idx) {
var content = yield Q.nfcall(fs.readFile, file);
// do something usefull
}).then(function () {
// co-foreach is returning promise which is fulfilled
// after all generator functions are successfully finished
}).catch(function (err) {
// handle error
});
var forEach = require('co-foreach');
// You can also use co-foreach with normal callbacks
forEach(array, function (item, idx) {
});
MIT
FAQs
Run generator function as forEach loop callback
The npm package co-foreach receives a total of 10 weekly downloads. As such, co-foreach popularity was classified as not popular.
We found that co-foreach 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.
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.