New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sebastianfoth/winston-nodemailer

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sebastianfoth/winston-nodemailer - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

2

dist/interfaces/body-template-data.interface.d.ts

@@ -6,2 +6,4 @@ import { IErrorDetails } from './error-details.interface';

pid: number;
application: string;
environment: string;
}

@@ -6,2 +6,4 @@ import { IErrorDetails } from './error-details.interface';

pid: number;
application: string;
environment: string;
}

@@ -10,3 +10,4 @@ import { SendMailOptions } from 'nodemailer';

waitUntilSend?: number;
application?: string;
timestamp?: () => string;
}

@@ -13,2 +13,3 @@ import * as Transport from 'winston-transport';

private template;
private application;
constructor(options: IWinstonNodemailerOptions);

@@ -19,2 +20,4 @@ log(info: any, callback: LogCallback): void;

private returnRenderedBody;
private returnDefaultSubject;
private returnDefaultTemplate;
}

@@ -15,4 +15,5 @@ "use strict";

this.waitUntilSend = options.waitUntilSend || 60000;
this.subject = options.subject || ``;
this.template = options.template || ``;
this.subject = options.subject || this.returnDefaultSubject();
this.template = options.template || this.returnDefaultTemplate();
this.application = options.application || ``;
this.timestamp = options.timestamp || (() => (new Date()).toISOString());

@@ -72,2 +73,4 @@ this.transporter = nodemailer_1.createTransport(options);

pid: process.pid,
application: this.application,
environment: process.env.NODE_ENV,
}, {

@@ -77,2 +80,4 @@ errorDetails: this.errorDetailsBuffer,

pid: process.pid,
application: this.application,
environment: process.env.NODE_ENV,
}, callback);

@@ -83,3 +88,2 @@ }, this.waitUntilSend);

sendMail(subjectTemplateData, bodyTemplateData, callback) {
console.log(this.errorDetailsBuffer.join(''));
this.transporter

@@ -96,13 +100,57 @@ .sendMail(Object.assign({}, this.options.sendMailOptions, this.options.smtpOptions, { subject: this.returnRenderedSubject(this.subject, subjectTemplateData), text: this.returnRenderedBody(this.template, bodyTemplateData) }), callback);

pid: templateData.pid,
hostname: templateData.hostname
hostname: templateData.hostname,
application: templateData.application,
});
}
returnRenderedBody(subject, templateData) {
return mustache.render(subject, {
returnRenderedBody(template, templateData) {
return mustache.render(template, {
errors: templateData.errorDetails,
pid: templateData.pid,
hostname: templateData.hostname
hostname: templateData.hostname,
application: templateData.application,
});
}
returnDefaultSubject() {
return `{{application}} | {{environment}} | {{level}} | Error Report`;
}
returnDefaultTemplate() {
return `
<h1>Error Report from {{application}} - {{hostname}}</h1>
<table>
{{#errors}}
<tr>
<td>
{{error.timestamp}}
</td>
<td>
{{error.level}}
</td>
<td>
{{error.message}}
</td>
<td>
{{error.meta}}
</td>
<td>
{{error.error.message}}
</td>
<td>
{{error.error.name}}
</td>
<td>
{{error.error.stack}}
</td>
</tr>
{{/errors}}
</table>
<small>Generated by winston-nodemailer</small>
`;
}
}
exports.WinstonNodemailer = WinstonNodemailer;

2

package.json
{
"name": "@sebastianfoth/winston-nodemailer",
"version": "0.0.6",
"version": "0.0.7",
"description": "A nodemailer transport for winston 3.x",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc