Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
errormailer
Advanced tools
Sending email for each error in your node app was never easier! It supports connect and express.
Sending email for each error must be easy! The most basic form of error notification is sending an email for each error, and it must be super-easy to set up in node applications.
errormailer is based upon the awesome Nodemailer, so you will have to configure it before usage.
var nodemailer = require("nodemailer");
var errormailer = require("errormailer");
// create reusable transport method (opens pool of SMTP connections)
var transport = nodemailer.createTransport("SMTP",{
service: "Gmail",
auth: {
user: "gmail.user@gmail.com",
pass: "userpass"
}
});
var errorHandler = errormailer(transport, {
subject: "Testing errormailer!",
to: "matteo.collina@gmail.com"
});
errorHandler("this is an error!");
Currently error emails are only sent for production environments. But if you want it to send always, use the option sendAlways
. There is also an option ignore
where you can specify your own logic when to ignore an error to be sent, for example:
var errorHandler = errormailer(transport, {
subject: "Testing errormailer!",
to: "matteo.collina@gmail.com",
ignore: function(errorToBeSent) {
// any errors won't be sent that have a code && it's below 400
return errorToBeSent.code && errorToBeSent.code < 400;
}
});
Sometimes error objects come with unusual properties you'd like to see in the error mail. Just set debugProperties
to true to get them all in the error mail. This can be useful if you want to inspect errors deeper.
var errorHandler = errormailer(transport, {
subject: "Enable debug mode",
to: "matteo.collina@gmail.com",
debugProperties: true
});
If you pass an genuine Error object onto errormailer, then toString()
will be called to retrieve the error message. Like that, this enables the develope to customize the message output by overriding toString()
in an error sub class.
errormailer fully supports Connect and Express, just use the
built function (errorHandler
in the previous example) as a middleware.
See this (Example)
for more details.
npm install nodemailer --save
npm install node-errormailer --save
errormailer supports:
The html email template it is based on MailChimp's email blueprints: https://github.com/mailchimp/Email-Blueprints
The html email template is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License: http://creativecommons.org/licenses/by-sa/3.0/
Copyright (c) 2013-2018 Matteo Collina, http://matteocollina.com Michael Heuberger, https://binarykitchen.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Sending email for each error in your node app was never easier! It supports connect and express.
The npm package errormailer receives a total of 2 weekly downloads. As such, errormailer popularity was classified as not popular.
We found that errormailer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.