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.
A tiny lightweight logger module used by many codeProgressive projects. The logger is designed to easily log on different levels such as; 'error' and 'warning'. It also gives the option to write the log to a file in a descent manner. A timestamp will automatically be included for your convenience.
$ npm install cp-logger
Instantiate and initialize the logger module.
var log = require( 'cp-logger' ).init( <level> , <options> )
Both parameters are optional.
The level parameter is a number from 0 to 3 defining the maximum level of logs to be shown. This way, when using different environments, you can set the level accordingly. When set to 0, only errors will be shown and when set to 3; all logs will be shown.
The options parameter is optional but when used, should be an object containing overrides to the options which are set by default.
After initializing you can easily log messages using the following methods:
Will be used when the log level set equals 3
log.debug( "This is some debug information" );
Will be used when the log level set equals 2 or higher
log.info( "This is some information" );
Will be used when the log level set equals 1 or higher
log.warning( "This is a warning" );
log.error( "This is an error" );
Here is an example on how to initialize the logger
The options object can override each of the following options;
catchAllExceptions : Boolean (default : false)
colors : Boolean (default true)
sendToScreen : Boolean (default true)
saveToFile : Boolean (default false)
filePath : String (default "./app.log")
GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
FAQs
A tiny lightweight logger module used by many codeProgressive projects.
The npm package cp-logger receives a total of 0 weekly downloads. As such, cp-logger popularity was classified as not popular.
We found that cp-logger 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.