I'm using the nodemailer npm module, which references the mailcomposer npm module, which in turn references the mime npm module. The mime module outputs a bunch of ugly, spammy debug messages if process.env.DEBUG is true.
Yes, I want debug messages, but only for MY code. How can I stop the mime module from outputting its own debug messages?
I've tried setting process.env.DEBUG (which the mime module looks at) to false right before requiring the nodemailer module, but it doesn't seem to affect the state of the mime module.
Have you tried to overwrite the process.stdout.write function?
Something like this:
var log = process.stdout.write;
process.stdout.write = function (){};
Then, when you need to output something:
log ("my message to console");