Security News
UK Officials Consider Banning Ransomware Payments from Public Entities
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Log Library for Node.js
This library enables the followings in Node.js Application.
It is required that Nodemailer is installed.
$ npm install nodemailer
and,
$ echo "export NODE_PATH='/usr/local/lib/node_modules/'" >> ~/.bashrc
var NodeLogger = require('./NodeLogger.js');
// Log file path
var log = 'error.log';
// for sending mail
var settings = {
service : 'Gmail',
auth : {
user : 'sample@gmail.com',
pass : 'xxxxxx',
port : 25
}
};
// Create the instance of NodeLogger
var nodeLogger = new NodeLogger(log, settings);
In the case of not sending mail,
var NodeLogger = require('./NodeLogger.js');
// Log file path
var log = 'error.log';
// Create the instance of NodeLogger
var nodeLogger = new NodeLogger(log);
In the case of showing log message on console.
var message = 'showLog'; // Log message
var lineNo = 22; // Line number
var method = 'error'; // This method is console object
nodeLogger.showLog(message, lineNo, method);
In the case of recording log message in log file.
var message = 'showLog'; // Log message
var lineNo = 23; // Line number
nodeLogger.appendLog(message, lineNo);
In the case of sending emergency mail.
Please refer to Nodemailer for details.
var options = {
to : 'sample@gmail.com',
subject : 'NodeLogger TEST',
html : 'sendMail',
from : 'node-ninja'
};
// This callback is executed when sending mail is successful.
var successCallback = function(result) {
console.dir(result);
};
// This callback is executed when sending mail failed.
var errorCallback = function(result, error) {
console.dir(result);
console.dir(error);
};
nodeLogger.sendMail(options, successCallback, errorCallback);
FAQs
Log Library for Node.js
The npm package nodelogger receives a total of 6 weekly downloads. As such, nodelogger popularity was classified as not popular.
We found that nodelogger 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
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.