Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including winston-email with all npm packages installed. Try it out:

require("winston/package.json"); // winston is a peer dependency. var winstonEmail = require("winston-email")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

winston-email v0.1.0

An email transport for winston


email transport logging for winston using nodemailer


$ npm install winston-email


add an email option to your logger

var winston = require('winston');

winston.loggers.add('logger', {
  email: {
    from   : 'xxx',
    to     : 'xxx',
    service: 'Gmail',
    auth   : { user: 'xxx', pass: 'xxx'},
    tags   : ['your app'] //optional tags for the subject
  // other transports

logger = winston.loggers.get('logger');"info msg", {title:'optional title'});


FROM=<youremail> TO=<youremail> USER=<youremail> PASS=<your pwd> node test
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free