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.
node-discord-logger
Advanced tools
Send logs to Discord from your NodeJS application. See detailed documentation
npm i -S node-discord-logger
import DiscordLogger from 'node-discord-logger';
const logger = new DiscordLogger({
hook: 'https://your/discord/webhook',
icon: 'https://icon/for/service', // optional, will be included as an icon in the footer
serviceName: 'My NodeJS Service', // optional, will be included as text in the footer
defaultMeta: { // optional, will be added to all the messages
'Process ID': process.pid,
Host: os.hostname(), // import os from 'os';
},
errorHandler: err => { // optional, if you don't want this library to log to console
console.error('error from discord', err);
}
});
logger.error({
message: 'This is an error message',
error: new Error('sample error') // This field can be included in other log functions as well
});
logger.warn({ message: 'This is warning message' });
logger.debug({
message: 'This is a debug message',
json: { debug: 'data' } // This field can be included in other log functions as well
});
logger.info({
message: 'This is a info message',
description: 'Some additional description' // This field can be included in other log functions as well
});
logger.verbose({ message: 'This is a verbose message' });
logger.silly({ message: 'This is a silly message' });
Field | Type | Description | Required |
---|---|---|---|
message | string | Main log message | yes |
description | string | Log message description | no |
error | Error | Error object to be logged with the message | no |
meta | { [key: string]: string | number | Date } | Meta details for log message | no |
json | any (Valid JSON object) | Additional JSON to be logged in discord message | no |
description
field in log message. See usage.FAQs
Nodejs logger for Discord
We found that node-discord-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.