The point of javascript is that it is executed in the user's browser.
Sometimes that javascript code does a bunch of things and then invokes the server to get the answer; in such a case if you tracked far enough and built all of the structures you could invoke the server directly.
But sometimes the javascript code does the entire calculation. In that case, you need to find a way to execute it.
If you are using MS Windows then if you look at the last entry in this post it appears to show a way to create a browser context to run javascript, from which the result could be fetched.