0.0.4 • Published 4 months ago

erroremail v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

erroremail

Middleware which logs error and sends to email.

Prerequisite

  • Node.js on your platform
  • Setup Gmail for app authorization

Installation

npm install erroremail --save-dev

Example

// Import our library
var erroremail = require('erroremail');

// App get
app.get('/example', (req, res, next)=>{
    try {
        res.json({"Happy Coding!"});
    } catch(err){
        next(err);
    }
});

// Error Handler Middleware
app.use(erroremail('Gmail', 'Your@gmail.com', 'Gmail App Password'));

Single target email address example

app.use(erroremail('Gmail', 'Your@gmail.com', 'Gmail App Password', 'Tomail@gmail.com'));

Multiple emails example

app.use(erroremail('Gmail', 'Your@gmail.com', 'Gmail App Password', ['Tomail@gmail.com', 'Tomail@gmail.com']));

License

MIT

0.0.4

4 months ago

0.0.3

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago