0

I need to run a Javascript file for a relatively long time(maybe about 5 weeks or so at one time), without it stopping or being interrupted. Currently the script is a client side script which connects to the server and receives data via Sockjs. There is no HTMl/GUI. There is only some computation.

Could anyone give me some pointers? What are my other options? Whats the best way to test a client javascript library which seems to work only on the browser?

This is the repo I am using : https://github.com/sockjs/sockjs-client It doesnt seems to be running on node. I tried to replace the script tag with require, and download the sock.js into a separate file and use it.

Community
  • 1
  • 1
  • 1
    Anything that runs on the client without a UI should also be able to run in node -- though you might need a shim layer if you're doing Ajax calls. – Jeremy J Starcher Jul 29 '16 at 06:07

1 Answers1

0

There are "headless" browser modules available. These produce a virtual browser environment that can be programatically controlled. The primary use of these is to do unit/integration testing of browser side code without actually running a browser:

  1. Phantomjs
  2. Slimerjs

These might fit your needs. You can create a nodejs script that will load the said code in a virtual browser page.

S.D.
  • 29,290
  • 3
  • 79
  • 130