Node.js Compile & Run Script for Windows

When developing on node.js, I find that I do this routine a lot:

  1. Make code change
  2. Kill/restart node.js process
  3. Reload browser
Instead of switching between 3 windows, I decided to make a batch script (.bat) to do this for me. As an added extra, it also concatinates separate javascript files too.


c:
cd C:\yourworkingdirectory\
taskkill /IM node.exe /F
taskkill /IM firefox.exe /F
rm server.js
type globals.js game.js nodeserver.js > server.js
start "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" "http://localhost/"
node server.js

 

 

P.S. Yes, sometimes I do develop in windows. Until AAA games are developed for linux I will continue occasionally.

2 comments

  1. Jake says:

    Do you know any way of hotswapping files in nodejs? Its a pita to restart my servers any time a make a small change in any of the source files…

  2. Thanks , I’ve just been searching for information about this topic for a while and yours is the greatest I’ve discovered till now. But, what concerning the conclusion? Are you sure about the supply?

Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes