So I have the following:
<
1,3. "\n" does work. If you do a document.write inside the body tag you can check document.body.innerHTML and see that the line break is indeed there.
4.Anything HTML specific will be rendered HTML specific, so you will have to escape < and > into < and > for instance.
5.document is an object available in browsers, it is not used in node since the DOM doesn't exist there. require("sys"); and use sys.print in nodejs.