One quick solution to prettify Javascript is to use js-beautify from NodeJs module beautifier.
To install js-beautify:
npm -g install js-beautify
Then in Geany, go to Edit-> Format -> Send selection to -> Custom command
add a command like « js-beautify – »
Then open a javascript to beautify.
Select all, right click -> Format -> Send selection to -> js-beautify