winston-mail
Advanced tools
Comparing version 0.2.1 to 0.2.2
0.2.2 / 2012-06-14 | ||
================== | ||
* updated; test suite | ||
* adding; underscore templating to subject line [danielschwartz] | ||
0.2.1 / 2012-02-27 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -8,7 +8,13 @@ /* | ||
var util = require('util'); | ||
var os = require('os'); | ||
var email = require('emailjs'); | ||
var util = require('util'); | ||
var os = require('os'); | ||
var email = require('emailjs'); | ||
var winston = require('winston'); | ||
var _ = require('underscore'); | ||
// Set Underscore to Mustache style templates | ||
_.templateSettings = { | ||
interpolate : /\{\{(.+?)\}\}/g | ||
}; | ||
/** | ||
@@ -28,5 +34,6 @@ * @constructs Mail | ||
this.to = options.to; | ||
this.from = options.from || "winston@" + os.hostname() | ||
this.level = options.level || 'info'; | ||
this.silent = options.silent || false; | ||
this.from = options.from || "winston@" + os.hostname() | ||
this.level = options.level || 'info'; | ||
this.silent = options.silent || false; | ||
this.subject = options.subject ? _.template(options.subject) : _.template("winston: {{level}} {{msg}}") | ||
@@ -42,3 +49,2 @@ this.handleExceptions = options.handleExceptions || false; | ||
}); | ||
}; | ||
@@ -76,3 +82,3 @@ | ||
to: this.to, | ||
subject: "winston: " + level + " " + msg, | ||
subject: this.subject({level: level, msg: msg}), | ||
text: body | ||
@@ -82,3 +88,2 @@ }); | ||
this.server.send(message, function (err) { | ||
console.log(err); | ||
if (err) self.emit('error', err); | ||
@@ -85,0 +90,0 @@ self.emit('logged'); |
{ | ||
"name": "winston-mail", | ||
"description": "A mail transport for winston", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"author": "Marc Harter <wavded@gmail.com>", | ||
@@ -15,3 +15,4 @@ "contributors": [ | ||
"dependencies": { | ||
"emailjs": "" | ||
"emailjs": "", | ||
"underscore": "" | ||
}, | ||
@@ -18,0 +19,0 @@ "devDependencies": { |
@@ -41,2 +41,3 @@ # winston-mail [![Build Status](https://secure.travis-ci.org/wavded/winston-mail.png)](http://travis-ci.org/wavded/winston-mail) | ||
* __password__ Password for server auth | ||
* __subject__ Subject for email (default: winston: {{level}} {{msg}}) | ||
* __ssl:__ Use SSL (boolean or object { key, ca, cert }) | ||
@@ -43,0 +44,0 @@ * __tls:__ Boolean (if true, use starttls) |
@@ -14,5 +14,4 @@ /* | ||
smtp.listen(2500, function (err) { | ||
console.log(arguments) | ||
}) | ||
smtp.listen(2500, function (err) { if (err) console.log(err); }); | ||
smtp.on('dataReady', function (env, cb) { cb(null, 'abc'); }); | ||
@@ -22,6 +21,5 @@ function assertMail (transport) { | ||
assert.isFunction(transport.log); | ||
}; | ||
} | ||
var config = helpers.loadConfig(__dirname) | ||
var transport = new (Mail)(config.transports.mail); | ||
var transport = new (Mail)({ to: 'wavded@gmail.com', from: 'dev@server.com', port: 2500 }); | ||
@@ -28,0 +26,0 @@ vows.describe('winston-mail').addBatch({ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6391
48
2
7
104
2
+ Addedunderscore@
+ Addedunderscore@1.13.7(transitive)