Comparing version 0.0.1 to 0.0.2
@@ -93,3 +93,3 @@ (function () { | ||
Nark.prototype.alert = function (text,data,callback) { | ||
Nark.prototype.danger = function (text,data,callback) { | ||
@@ -101,3 +101,3 @@ console.error(colors.red(text)); | ||
text:text, | ||
type:'alerta', | ||
type:'danger', | ||
datails:text + data | ||
@@ -125,2 +125,32 @@ }).catch(function (err) { | ||
Nark.prototype.important = function (text,data,callback) { | ||
console.log(colors.blue(text)); | ||
data = Nark._table(data); | ||
this.Log.create({ | ||
text:text, | ||
type:'important', | ||
datails:text + data | ||
}).catch(function (err) { | ||
console.error(err); | ||
}); | ||
var mailOptions = { | ||
from: 'Nark <alerts@nark.com>', | ||
to: this.reportTo, | ||
subject: 'Nark Alert', | ||
text: text + data, | ||
html: text + data | ||
}; | ||
var transporter = this.transporter; | ||
transporter.sendMail(mailOptions,function (err,data) { | ||
if (err) | ||
console.error(err); | ||
}); | ||
}; | ||
Nark._table = function (data) { | ||
@@ -127,0 +157,0 @@ |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"repository": { | ||
@@ -11,0 +11,0 @@ "type": "git", |
@@ -59,3 +59,13 @@ # Nark | ||
``` | ||
nark.error('Bad news :('); | ||
nark.danger('Bad news :('); | ||
``` | ||
Do you need to send additional information? nark can help you | ||
``` | ||
nark.important('Important message with extra information',{foo:123123,bar:4234234}); | ||
``` | ||
The information will arrive to your emails like this | ||
![]() |
5740
134
71