So it seems this issue has been raised before, a couple of years ago but none of the responses seemed to work on the newest version of Notepad++ 6.2.2
I've also tried using the NppAutoIndent plugin to no avail.
For javascript, you can try JsMin (JsTool) plugin. It has jsformatter function.