{"id":13548899,"url":"https://github.com/sindresorhus/electron-debug","last_synced_at":"2025-05-14T14:10:19.492Z","repository":{"id":55571671,"uuid":"36633489","full_name":"sindresorhus/electron-debug","owner":"sindresorhus","description":"Adds useful debug features to your Electron app","archived":false,"fork":false,"pushed_at":"2024-10-14T06:23:11.000Z","size":75,"stargazers_count":765,"open_issues_count":10,"forks_count":48,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-05-06T05:42:39.293Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/sindresorhus.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","buy_me_a_coffee":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2015-06-01T02:36:20.000Z","updated_at":"2025-04-22T13:33:56.000Z","dependencies_parsed_at":"2024-11-08T20:24:03.438Z","dependency_job_id":"987ae189-8815-44d1-b350-39f13f53ef23","html_url":"https://github.com/sindresorhus/electron-debug","commit_stats":{"total_commits":109,"total_committers":15,"mean_commits":7.266666666666667,"dds":"0.23853211009174313","last_synced_commit":"d455a470d11581cc0457803d3fd9469d8c3189cf"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Felectron-debug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Felectron-debug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Felectron-debug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Felectron-debug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/electron-debug/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254160557,"owners_count":22024571,"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-01T12:01:15.802Z","updated_at":"2025-05-14T14:10:19.445Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","readme":"# electron-debug\n\n\u003e Adds useful debug features to your [Electron](https://electronjs.org) app\n\n## Features\n\n### DevTools\n\nToggle DevTools.\n\n- macOS: \u003ckbd\u003eCmd\u003c/kbd\u003e \u003ckbd\u003eAlt\u003c/kbd\u003e \u003ckbd\u003eI\u003c/kbd\u003e or \u003ckbd\u003eF12\u003c/kbd\u003e\n- Linux: \u003ckbd\u003eCtrl\u003c/kbd\u003e \u003ckbd\u003eShift\u003c/kbd\u003e \u003ckbd\u003eI\u003c/kbd\u003e or \u003ckbd\u003eF12\u003c/kbd\u003e\n- Windows: \u003ckbd\u003eCtrl\u003c/kbd\u003e \u003ckbd\u003eShift\u003c/kbd\u003e \u003ckbd\u003eI\u003c/kbd\u003e or \u003ckbd\u003eF12\u003c/kbd\u003e\n\n### Reload\n\nForce reload the window.\n\n- macOS: \u003ckbd\u003eCmd\u003c/kbd\u003e \u003ckbd\u003eR\u003c/kbd\u003e or \u003ckbd\u003eF5\u003c/kbd\u003e\n- Linux: \u003ckbd\u003eCtrl\u003c/kbd\u003e \u003ckbd\u003eR\u003c/kbd\u003e or \u003ckbd\u003eF5\u003c/kbd\u003e\n- Windows: \u003ckbd\u003eCtrl\u003c/kbd\u003e \u003ckbd\u003eR\u003c/kbd\u003e or \u003ckbd\u003eF5\u003c/kbd\u003e\n\n### Element Inspector\n\nOpen DevTools and focus the Element Inspector tool.\n\n- macOS: \u003ckbd\u003eCmd\u003c/kbd\u003e \u003ckbd\u003eShift\u003c/kbd\u003e \u003ckbd\u003eC\u003c/kbd\u003e\n- Linux: \u003ckbd\u003eCtrl\u003c/kbd\u003e \u003ckbd\u003eShift\u003c/kbd\u003e \u003ckbd\u003eC\u003c/kbd\u003e\n- Windows: \u003ckbd\u003eCtrl\u003c/kbd\u003e \u003ckbd\u003eShift\u003c/kbd\u003e \u003ckbd\u003eC\u003c/kbd\u003e\n\n## Install\n\n```sh\nnpm install electron-debug\n```\n\n*Requires Electron 30 or later.*\n\n## Usage\n\n```js\nimport {app, BrowserWindow} from 'electron';\nimport debug from 'electron-debug';\n\ndebug();\n\nlet mainWindow;\n(async () =\u003e {\n\tawait app.whenReady();\n\tmainWindow = new BrowserWindow();\n})();\n```\n\n## API\n\nOnly runs when in [development](https://github.com/sindresorhus/electron-is-dev), unless overridden by the `isEnabled` option. So no need to guard it for production.\n\n### electronDebug(options?)\n\nInstall keyboard shortcuts and optionally activate DevTools on each created `BrowserWindow`.\n\n#### options\n\nType: `object`\n\n##### isEnabled\n\nType: `boolean`\n\n##### showDevTools\n\nType: `boolean`\\\nDefault: `true`\n\nShow DevTools on each created `BrowserWindow`.\n\n##### devToolsMode\n\nType: `string`\\\nDefault: `'previous'`\\\nValues: `'undocked'` `'right'` `'bottom'` `'previous'` `'detach'`\n\nThe dock state to open DevTools in.\n\n##### windowSelector\n\nType: `(window: BrowserWindow) =\u003e boolean | Partial\u003cOptions\u003e`\\\nDefault: `() =\u003e true` (Use the global options for every window)\n\nSpecify customized options for each window.\n\nThe given function receives the window to apply the filter or new options to.\n\nIt must return one of these values:\n- `true`: To enable debug with the global options for the given window.\n- `false`: Disable debug for the given window (same as returning `{isEnabled: false}`).\n- `Partial\u003cOptions\u003e`: Object to override global options just for the given window. It does a shallow merge.\n\n### devTools(window?)\n\nToggle DevTools for the specified `BrowserWindow` instance or the focused one.\n\n#### window\n\nType: `BrowserWindow`\\\nDefault: The focused `BrowserWindow`\n\n### refresh(window?)\n\nReload the specified `BrowserWindow` instance or the focused one.\n\n#### window\n\nType: `BrowserWindow`\\\nDefault: The focused `BrowserWindow`\n\n### openDevTools([window])\n\nOpen DevTools for the specified `BrowserWindow` instance or the focused one.\n\n#### window\n\nType: `BrowserWindow`\\\nDefault: The focused `BrowserWindow`\n\n## Related\n\n- [electron-util](https://github.com/sindresorhus/electron-util) - Useful utilities for developing Electron apps and modules\n- [electron-store](https://github.com/sindresorhus/electron-store) - Save and load data like user settings, app state, cache, etc\n- [electron-context-menu](https://github.com/sindresorhus/electron-context-menu) - Context menu for your Electron app\n- [electron-dl](https://github.com/sindresorhus/electron-dl) - Simplified file downloads for your Electron app\n- [electron-unhandled](https://github.com/sindresorhus/electron-unhandled) - Catch unhandled errors and promise rejections in your Electron app\n- [electron-reloader](https://github.com/sindresorhus/electron-reloader) - Simple auto-reloading for Electron apps during development\n- [electron-serve](https://github.com/sindresorhus/electron-serve) - Static file serving for Electron apps\n","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://buymeacoffee.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["JavaScript","Tools","Library","三、开发者必备工具"],"sub_categories":["For Electron","Debug","2. 开发调试辅助"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Felectron-debug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Felectron-debug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Felectron-debug/lists"}