winston-mail
Advanced tools
Comparing version 0.0.1 to 0.1.0
@@ -9,2 +9,3 @@ /* | ||
var util = require('util'); | ||
var os = require('os'); | ||
var mail = require('mail'); | ||
@@ -21,4 +22,4 @@ var winston = require('winston'); | ||
if(!options.to){ | ||
throw "winston-mail requires 'to' property"; | ||
if(!options.to || !options.host){ | ||
throw "winston-mail requires 'to' and 'host' property"; | ||
} | ||
@@ -28,3 +29,3 @@ | ||
this.to = options.to; | ||
this.from = options.from || "no-reply@winston.com"; | ||
this.from = options.from || "winston@" + os.hostname() | ||
this.level = options.level || 'info'; | ||
@@ -31,0 +32,0 @@ this.silent = options.silent || false; |
{ | ||
"name": "winston-mail", | ||
"description": "A mail transport for winston", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"author": "Marc Harter <wavded@gmail.com>", | ||
@@ -6,0 +6,0 @@ "contributors": [], |
@@ -13,3 +13,3 @@ # winston-mail | ||
### Installing winston-mongodb | ||
### Installing winston-mail | ||
@@ -29,3 +29,3 @@ ``` bash | ||
// | ||
require('winston-mongodb').Mail; | ||
require('winston-mail').Mail; | ||
@@ -35,5 +35,6 @@ winston.add(winston.transports.Mail, options); | ||
The Mail transport uses [node-mail](https://github.com/weaver/node-mail) behind the scenes. Options are the following, `to` is required: | ||
The Mail transport uses [node-mail](https://github.com/weaver/node-mail) behind the scenes. Options are the following, `to` and `host` are required: | ||
* __to:__ The name of email address(es) you want to send to. *[required]* | ||
* __to:__ The address(es) you want to send to. *[required]* | ||
* __from:__ The address you want to send from. (default: `winston@[server-host-name]`) | ||
* __host:__ SMTP server hostname | ||
@@ -47,2 +48,2 @@ * __port:__ SMTP port (default: 587 or 25) | ||
[0]: https://github.com/indexzero/winston | ||
[0]: https://github.com/flatiron/winston |
/* | ||
* mongodb-test.js: Tests for instances of the MongoDB transport | ||
* winston-mail-test.js: Tests for instances of the Mail transport | ||
* | ||
@@ -13,2 +13,4 @@ * (C) 2011 Marc Harter | ||
console.log('Note this test file uses a internal SMTP server, modify fixtures/test-config to your SMTP server'); | ||
function assertMail (transport) { | ||
@@ -15,0 +17,0 @@ assert.instanceOf(transport, Mail); |
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
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
4806
7
95
46