There are a variety of ways of doing server side scripting. Node.js is one solution, but even PHP, Ruby, or Python will let you do server side calculations.
It doesn't matter though, because if your game is heavily client side JS, anyone with a greasemonkey plugin installed can cheat.