
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Error Event Handller.
npm install --save eerr
var eerr = require('eerr');
eerr.setup({
badrequest: { status: 400, message: 'Bad Request.' },
unauthorized: { status: 401, message: 'Unauthorized.' },
forbidden: { status: 403, message: 'Forbidden' },
notfound: { status: 404, message: 'Not Found.' },
internalservererror: { status: 500, message: 'Internal Server Error.' },
gatewaytimeout: { status: 504, message: 'Gateway Timeout.' }
});
// error code event.
eerr.on('badrequest', function(err) {
console.log('bad request!');
});
// error status event.
eerr.on('404', function(err) {
console.log('not found!');
});
// error status event.
eerr.on('4XX', function(err) {
console.log('client error!');
});
var err = eerr('notfound');
console.log(err.name, err.code, err.status, err.message, err.stack);
// -- output
// not found!
// client error!
// Error notfound 404 Not Found ErrorStack...
npm test; npm run-script jshint
command and confirm that it passesFAQs
Error Event Handller
The npm package eerr receives a total of 2 weekly downloads. As such, eerr popularity was classified as not popular.
We found that eerr 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.