I created a command line tool to prepare some files, since we don't have the scripting package I simply used Node.js as tool and passed it my script.

My tool writes to the output file correctly when there are no problems, but writes to stderr when there are errors. How do I read from stderr and maybe generate some log file?