
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.
MError: VError with error levels
VError is a really awesome NPM module. MError inherits from VError and adds some nice APIs that make it a bit nicer to work with (for me anyway, use it or don't).
The main API is documented by the VError module, so we will only go into detail on what is added.
MError.setupLevels(levels, defaultLevel)
You call this once to set up error log levels (in order of severity) that MError should be aware of, and to pass the default level that each error will carry until changed.
Example:
MError.setupLevels(['warning', 'error', 'fatal'], 'error');
error.getLevel()
Returns the current level of the error.
Example:
var error = new MError('Ouch');
console.log(error.getLevel()); // outputs: error
error.setLevel(level)
Changes the error level to any of the levels configured through MError.setupLevels.
Example:
var error = new MError('Ouch');
error.setLevel('fatal');
error.incLevel(level)
Changes the level to what is passed, but only if it's an increase in severity.
var error = new MError('Ouch');
error.incLevel('fatal');
error.decLevel(level)
Changes the level to what is passed, but only if it's a decrease in severity.
var error = new MError('Ouch');
error.decLevel('error');
The constructor does not require the "new" keyword to function. This fact, combined with function chaining, allows for one-liner patterns like this:
function statMyFile(cb) {
fs.stat(someFile, function (error, stats) {
if (error) {
return cb(MError(error, 'Stat failed').setLevel('fatal'));
}
return cb(null, stats);
});
});
FAQs
MError: VError with error levels
The npm package merror receives a total of 1 weekly downloads. As such, merror popularity was classified as not popular.
We found that merror 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.