Package Exports
- winston-mail-lite
- winston-mail-lite/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (winston-mail-lite) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
winston-mail-lite
Yet another email transport for winston.
Installation
$ npm install winston winston-mail-liteUsage
const winston = require('winston');
const Mail = require('winston-mail-lite');
const transport = new Mail(options);
const logger = winston.createLogger({ transports: [transport] });The Mail transport uses nodemailer behind the scenes.
Options specific to winston-mail-lite are the following:
transportOptions: options passed tocreateTransport()(for SMTP transport, for other transports). By default, JSON transport is used.messageOptions: options passed totransport.sendMail(). The most common options are:from: email address of the sender; if nothing is provided, defaults towinston@[server-host-name], whereserver-host-nameis whatos.hostname()returns;to: email address of the recipient; this option is required;subject: the subject of the email; defaults toWinston Message. Supports{{ level }}and{{ message }}placeholders (logs severity and the first line of the message respectively).
Differences to winston-mail
winston-mail-lite was inspired by winston-mail.
The key differences are:
winston-mail-litehas less dependencies;- uses
nodemailerinstead of emailjs; - has all of its dependencies up-to-date (winston-mail depends on a package with a vulnerability);
- supports only winston >= 3;
- has much more simplier codebase.