Wondering what’s next for npm?Check out our public roadmap! »

    winston-mail-lite

    1.0.13 • Public • Published

    winston-mail-lite

    Build and Test CI NPM Scrutinizer Code Quality Code Coverage Build Status

    Yet another email transport for winston.

    Installation

    $ npm install winston
    $ npm install winston-mail-lite

    Usage

    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 to createTransport() (for SMTP transport, for other transports). By default, JSON transport is used.
    • messageOptions: options passed to transport.sendMail(). The most common options are:
      • from: email address of the sender; if nothing is provided, defaults to winston@[server-host-name], where server-host-name is what os.hostname() returns;
      • to: email address of the recipient; this option is required;
      • subject: the subject of the email; defaults to Winston 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:

    Install

    npm i winston-mail-lite

    DownloadsWeekly Downloads

    81

    Version

    1.0.13

    License

    MIT

    Unpacked Size

    11.8 kB

    Total Files

    8

    Last publish

    Collaborators

    • avatar