Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Log Library for Node.js
This library enables the followings in Node.js Application.
$ npm install nodelogger
It is required that Nodemailer is installed.
$ npm install
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);
Copyright (c) 2014 Tomohiro IKEDA (Korilakkuma)
Released under the MIT license
FAQs
Log Library for Node.js
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.