nark
v0.1.1
Published
Alerts and logs for your projects, nark will tell you when something goes wrong or an important event happens
Downloads
27
Maintainers
Readme
Nark
Send alerts (emails) when something goes terrible wrong or an important event happens in your app, it also helps to keep track of the logs of your application to generate reports with that information.
Introduction
Nark uses nodemailer to send email alerts and sequelize to store all the logs with additional information.
Installation
npm install narkConfiguration
Enter your own credentials.
var Nark = require('nark');
nark = Nark.config({
app: 'Name of your project'
reportTo:'[email protected]',
mailSettings:{
service: 'Gmail',
auth: {
user: '[email protected]',
pass: '123456'
}
},
dbSettings:{
database:'mydb',
user:'myuser',
password:'mypasswd',
host:'localhost'
}
});Documentation
Save log and print it:
nark.log('Hola bartola');You need to save additional information?
nark.log('Print a table for me please',{
'Name':'Bartola',
'Email':'[email protected]'
})It will print something like this:
┌───────┬───────────────┐
│ Field │ Value │
├───────┼───────────────┤
│ Name │ Bartola │
├───────┼───────────────┤
│ Email │ [email protected] │
└───────┴───────────────┘Save a warning and print it in console
nark.warning('this is a warning that won\'t be sent');Important message, will be saved in your database, printed in console and sent by email
nark.important('This is an important message that will be sent to the "reportTo" value');Errors, when shit hit the fan :/
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
