Is it at all possible to use javascript server side and thus not shown in page source for certain core calculations?
I'm developing a game, and one crucial part of the code needs to be only calculated server side then passed back to client.
My entire game is in Javascript - but most of it is client side which is fine except this one particular function which needs to hidden from view to prevent cheats.
Is this possible - if so how would I set up server side JS ?
You'll want to look at node.js. Node.js allows you to run javascript code on the server and is very easy to get up and running to accept and respond to http requests. You'll probably also want to take a look at expressjs which makes implementing a Node.js server even easier.