Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
logged-errors
Advanced tools
restify component (errors), extracted from "restify" with additional chainable features
This module is a simple fork of the restify-errors with some chainable features:
Install logged-errors
as usual:
$ npm install --save logged-errors
For browser environment add logged-error.js
file in build folder.
// see the examples folder
// dependencies
var LoggedErrors = require('logged-errors');
// add the stack to the body of the error
throw new LoggedErrors.NotFoundError('some error').withStack().log();
// the following statements are equivalent
throw new LoggedErrors.NotFoundError('some error').withStack().toArray().log();
throw new LoggedErrors.NotFoundError('some error').withStack(true).log();
// set a new format and a custom logger (default is console)
LoggedErrors.set({
format: function (e) {
return 'error occurred: ' + e.message;
},
logger: require('winston')
});
// change on the fly the content used for the log using the defult format
// use body (default)
throw new LoggedErrors.NotFoundError('some error').log();
// use message (set mode !== 'body')
throw new LoggedErrors.NotFoundError('some error').log('msg');
// compose a message for the error
throw new LoggedErrors.NotFoundError('some error with %s and %s', 'first parameter', 'second parameter').log();
For other information please refer to restify documentation.
FAQs
restify component (errors), extracted from "restify" with additional chainable features
The npm package logged-errors receives a total of 2 weekly downloads. As such, logged-errors popularity was classified as not popular.
We found that logged-errors 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.