
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.
As you probably have noticed during your node.js development, it is really easy to get deep into callback mess. Consider the following code:
var fs = require('fs');
fs.readFile('/etc/passwd',
function(err, data) {
if (err) {
handleError(err);
return;
}
fs.writeFile('myPwdCopy.txt',
function(err) {
if (err) {
handleError(err);
}
fileCopiedCallback();
}
);
}
);
Here we just copied a file from one place to another, and yet we already have three levels of folding.
Node-chain is perhaps a naive attempt to solve this problem. Consider the solution:
var fs = require('fs'),
runChain = require('node-chain').runChain,
chain = [
// Step 1: call fs.readFile and pass the 'data' as argument
{
target: fs.readFile,
args: ['/etc/passwd'],
errorHandler: handleErrors,
passResultToNextStep: true
},
// Step 2: call fs.writeFile
{
target: fs.writeFile,
errorMessage: 'Unable to write the file'
}
];
runChain(chain);
FAQs
Simple call chaining library for node.js
We found that node-chain 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.