{"size": 880, "ext": "js", "max_stars_repo_path": "main.js", "max_stars_repo_name": "imzacm/Z-Installer", "max_stars_repo_stars_event_min_datetime": "2020-02-23T06:57:41.000Z", "max_stars_repo_stars_event_max_datetime": "2020-02-23T06:57:41.000Z", "max_issues_repo_path": "main.js", "max_issues_repo_name": "imzacm/Z-Installer", "max_issues_repo_issues_event_min_datetime": "2017-10-14T14:14:12.000Z", "max_issues_repo_issues_event_max_datetime": "2020-06-02T21:44:05.000Z", "max_forks_repo_path": "main.js", "max_forks_repo_name": "imzacm/Z-Installer", "max_forks_repo_forks_event_min_datetime": "2017-10-14T16:02:11.000Z", "max_forks_repo_forks_event_max_datetime": "2017-10-14T16:02:11.000Z"}
{"max_stars_count": 1, "max_issues_count": 7, "max_forks_count": 1, "avg_line_length": 19.1304347826, "max_line_length": 62, "alphanum_fraction": 0.6045454545}
global.app = require('electron').app

let Window = require('electron').BrowserWindow,
  mainWindow = null,
  server = require('./server')

let self = this
self.startedPromise = () => {
  return new Promise((resolve, reject) => {
    self.startedRes = resolve
  })
}
self.closedPromise = () => {
  return new Promise((resolve, reject) => {
    self.closedRes = resolve
  })
}

app.on('Window-all-closed', () => {
  if (process.platform !== 'darwin') {
    app.quit()
  }
})

app.on('ready', () => {
  mainWindow = new Window({
    width: 900,
    height: 600
  })

  mainWindow.loadURL('http://localhost:' + server.config.port)

  self.startedRes()

  mainWindow.on('closed', () => {
    mainWindow = null
    self.closedRes()
  })
})

module.exports = {
  started: self.startedPromise().then(() => {return true}),
  closed: self.closedPromise().then(() => {
    return true
  })
}