{"id":13798460,"url":"https://github.com/parro-it/electron-detach","last_synced_at":"2025-04-30T08:20:41.606Z","repository":{"id":57138676,"uuid":"45136632","full_name":"parro-it/electron-detach","owner":"parro-it","description":"Restart an electron app as a detached process","archived":false,"fork":false,"pushed_at":"2018-12-15T13:13:07.000Z","size":14,"stargazers_count":59,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-22T16:59:40.211Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parro-it.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-28T19:25:12.000Z","updated_at":"2022-09-27T10:14:24.000Z","dependencies_parsed_at":"2022-09-03T15:51:53.349Z","dependency_job_id":null,"html_url":"https://github.com/parro-it/electron-detach","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Felectron-detach","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Felectron-detach/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Felectron-detach/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Felectron-detach/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parro-it","download_url":"https://codeload.github.com/parro-it/electron-detach/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251352605,"owners_count":21575863,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T00:00:44.246Z","updated_at":"2025-04-30T08:20:41.585Z","avatar_url":"https://github.com/parro-it.png","language":"JavaScript","funding_links":[],"categories":["Library","Tools"],"sub_categories":["Uncategorized","For Electron"],"readme":"# electron-detach\n\nThis module restart the app as a detached electron process,\nallowing an electron app to be started from terminal and\nsurvive parent process closure.\n\n[![Travis Build Status](https://img.shields.io/travis/parro-it/electron-detach.svg)](http://travis-ci.org/parro-it/electron-detach)\n[![NPM module](https://img.shields.io/npm/v/electron-detach.svg)](https://npmjs.org/package/electron-detach)\n[![NPM downloads](https://img.shields.io/npm/dt/electron-detach.svg)](https://npmjs.org/package/electron-detach)\n\n## Installation\n\n```bash\nnpm install --save electron-detach\n```\n\n## Usage\n\n```javascript\n  const electronDetach = require('electron-detach');\n\n  //returns true if your process is a detached child process\n  if (electronDetach({ requireCmdlineArg: false })) {\n    app.on('ready',()=\u003e{\n       //turn the app on\n    });\n  }\n```\n\n## Api\n\nCalling `electronDetach()` returns `true` if current process is already detached from the terminal.\nIf calling `electronDetach()` returns `false` the process will be killed as soon a detached one is spawned.\n\nIf calling `electronDetach()` returns `true`, this means that it is good to start your app now. If it returns `false`, your process will shortly be terminated.\n\n```javascript\nconst electronDetach = require('electron-detach');\nif(electronDetach()){\n  //Turn your app on, as your app is in a process that is not going to be killed\n} else {\n  //Your app is going to be killed. Respond accordingly\n}\n```\n\n### Option argument\n\nAn optional object containing following property:\n\n* requireCmdlineArg\n\nonly restart the app if --detach command line argument is present.\nDefaults to false.\n\n* outputPath\n\nPath to a file where stdout and stderr of detached process will be redirected. Defaults to /dev/null\n\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Andrea Parodi\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparro-it%2Felectron-detach","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparro-it%2Felectron-detach","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparro-it%2Felectron-detach/lists"}