@thyms refactored to use spawn instead of exec of nodejs.