{"size": 775, "ext": "js", "max_stars_repo_path": "nwjs_app/index.js", "max_stars_repo_name": "moritzwietersheim/specter-desktop", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "nwjs_app/index.js", "max_issues_repo_name": "moritzwietersheim/specter-desktop", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "nwjs_app/index.js", "max_forks_repo_name": "moritzwietersheim/specter-desktop", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.0, "max_line_length": 75, "alphanum_fraction": 0.7238709677}
var execFile = require('child_process').execFile;
var path = require('path');

var absolutePath = path.join(process.cwd(), 'specter_osx');
var server = execFile(absolutePath);

function exitHandler(options, exitCode) {
	server.kill('SIGINT');
}

//do something when app is closing
process.on('exit', exitHandler.bind(null,{cleanup:true}));

//catches ctrl+c event
process.on('SIGINT', exitHandler.bind(null, {exit:true}));

// catches "kill pid" (for example: nodemon restart)
process.on('SIGUSR1', exitHandler.bind(null, {exit:true}));
process.on('SIGUSR2', exitHandler.bind(null, {exit:true}));

//catches uncaught exceptions
process.on('uncaughtException', exitHandler.bind(null, {exit:true}));

nw.Window.open('index.html', { width:1200, height:800 }, function(win) {});
