{"id":13509612,"url":"https://github.com/rhysd/electron-about-window","last_synced_at":"2025-05-16T04:04:29.493Z","repository":{"id":3141955,"uuid":"48564252","full_name":"rhysd/electron-about-window","owner":"rhysd","description":"'About This App' mini-window for Electron apps","archived":false,"fork":false,"pushed_at":"2024-01-09T07:33:07.000Z","size":1949,"stargazers_count":421,"open_issues_count":22,"forks_count":45,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-10T09:04:13.376Z","etag":null,"topics":["electron","utility"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/about-window","language":"TypeScript","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/rhysd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2015-12-25T03:01:47.000Z","updated_at":"2025-03-17T01:04:33.000Z","dependencies_parsed_at":"2024-06-18T13:48:21.547Z","dependency_job_id":"9be34c72-160d-44d1-83b3-727af073e92f","html_url":"https://github.com/rhysd/electron-about-window","commit_stats":{"total_commits":165,"total_committers":19,"mean_commits":8.68421052631579,"dds":"0.21212121212121215","last_synced_commit":"9dc88da999d64e9a614d33adf649d566c0a35fcb"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Felectron-about-window","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Felectron-about-window/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Felectron-about-window/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhysd%2Felectron-about-window/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhysd","download_url":"https://codeload.github.com/rhysd/electron-about-window/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464893,"owners_count":22075570,"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":["electron","utility"],"created_at":"2024-08-01T02:01:10.332Z","updated_at":"2025-05-16T04:04:29.466Z","avatar_url":"https://github.com/rhysd.png","language":"TypeScript","readme":"'About This App' Window for [Electron](https://github.com/atom/electron) Apps\n=============================================================================\n[![npm version](https://badge.fury.io/js/about-window.svg)](https://www.npmjs.com/package/about-window)\n\n[This package](https://www.npmjs.com/package/about-window) provides 'About This App' window for [Electron](https://github.com/atom/electron) applications.\n\n- [x] Create 'About This App' window from given parameters\n  - [x] Icon path\n  - [x] Copy right\n  - [x] App name and Versions\n  - [x] Description\n- [x] Gather package information from package.json\n- [x] Automatically detect package.json\n- [x] Adjust window size to its contents automatically\n- [x] Optional close button\n- [x] CSS customizability\n\nYou can install this module via [npm](https://www.npmjs.com/).\n\n```sh\n$ npm install about-window\n```\n\n## Usage\n\nOnly one function is exported as default.  Please see [TypeScript type definition](index.d.ts).\nThe function can be called from both main process and renderer process.\n\n```typescript\nexport default function openAboutWindow(info: {\n    icon_path: string;\n    product_name?: string;\n    package_json_dir?: string;\n    about_page_dir?: string;\n    bug_report_url?: string;\n    bug_link_text?: string;\n    copyright?: string;\n    homepage?: string;\n    description?: string;\n    license?: string;\n    css_path?: string | string[];\n    adjust_window_size?: boolean;\n    win_options?: BrowserWindowOptions;\n    use_version_info?: boolean | [string, string][];\n    show_close_button?: string;\n    app?: Electron.App;\n    BrowserWindow?: typeof Electron.BrowserWindow;\n    ipcMain?: Electron.IpcMain;\n}): BrowserWindow\n```\n\nOnly `icon_path` property is required, others are optional.\nI recommend to specify as below to extract information from package.json as much as possible.\nPath to package.json is also automatically detected if possible.\n\n```typescript\nopenAboutWindow({\n    icon_path: 'path/to/icon.png'\n});\n```\n\nIf `string` value is passed to the first parameter, it is passed to `icon_path`. So following is a shorthand of above code:\n\n```typescript\nopenAboutWindow('path/to/icon.png');\n```\n\nYou can check [an example app](example) to know how to use this package.\n\n```sh\n$ git clone https://github.com/rhysd/about-window.git\n$ cd about-window/example\n$ npm install\n$ npm start\n\n# Or for debug\n$ npm run debug\n```\n\n### Parameter's properties of `openAboutWindow()`\n\n| Name | Description | Type |\n|------|-------------|------|\n| `icon_path` | Path to icon file of the application. The path is passed to `src` property of `\u003cimg\u003e` element. **Required** | string |\n| `package_json_dir` | Path to directory which contains package.json.  If not specified, it will try to detect a path to package.json.  If also failed, it gives up and show less information in 'About This App' window. **Optional** | string |\n| `bug_report_url` | URL to bug report page.  If not specified, 'bugs' entry in package.json is used. **Optional** | string |\n| `copyright` | Copyright notice shown in window.  If not specified, it is replaced with license description generated by 'license' entry of package.json. **Optional** | string |\n| `homepage` | URL of application's web page.  If not specified, 'homepage' entry of package.json is used instead. **Optional** | string |\n| `description` | Description of the application.  If not specified, 'description' entry of package.json is used instead. **Optional** | string |\n| `license` | License of the application.  If not specified, 'license' entry of package.json is used instead. This property is used when `copyright` is not specified. **Optional** | string |\n| `win_options` | Options of 'About This App' window.  It is merged into default options. **Optional** | [BrowserWindow options object](https://github.com/atom/electron/blob/master/docs/api/browser-window.md#new-browserwindowoptions) |\n| `css_path` | Path(s) to user-defined CSS file.  It will be inserted to DOM of the window. **Optional** | (array of) string |\n| `adjust_window_size` | Adjust the window size to its content not to show scroll bar. **Optional** | boolean |\n| `open_devtools` | For debug purpose, Chrome DevTools will start when the window is opened. **Optional** | boolean |\n| `use_inner_html` | If `true`, set the value with `.innerHTML` on copyright, license and description Default is `false`. **Optional** | boolean |\n| `bug_link_text` | Text for a bug report link. **Optional** | string |\n| `product_name` | Name of the application **Optional** | string |\n| `use_version_info` | If is `false`, nothing will be displayed, if is `true`, the versions of electron, chrome, node, and v8 will be displayed, if is an array of string tuple, its entries will be displayed. Default is `true`. **Optional** | boolean |\n| `show_close_button` | If this is a valid string, a close button with this string be displayed. **Optional** | string |\n| `about_page_dir` | Directory path which contains `about.html` which is rendered in 'About this app' window. **Optional** | string |\n| `app` | [app](https://www.electronjs.org/docs/latest/api/app) instance to use. This property is necessary only when using on renderer processes. **Optional** | Electron.App |\n| `BrowserWindow` | Constructor of [BrowserWindow](https://www.electronjs.org/docs/latest/api/browser-window) to use. This property is necessary only when using on renderer processes. **Optional** | Electron.BrowserWindow |\n| `ipcMain` | [ipcMain](https://www.electronjs.org/docs/latest/api/ipc-main) instance to use. This property is necessary only when using on renderer processes. **Optional** | Electron.IpcMain |\n\n**Note:** If you set `use_inner_html` to `true`, please ensure that contents don't contain any untrusted external input\nin order to avoid XSS. Be careful.\n\n### Open the window from non-main process\n\nSince `openAboutWindow()` depends on several APIs only available on main process, they must be provided by caller when it is called on non-main process.\n\nTo mimic the APIs, use [`@electron/remote`](https://www.npmjs.com/package/@electron/remote) module.\n\n```typescript\nimport {app, BrowserWindow, ipcMain} from '@electron/remote';\n\nopenAboutWindow({\n    icon_path: 'path/to/icon.png'\n    app,\n    BrowserWindow,\n    ipcMain,\n});\n```\n\n## Screen Shots\n\n### Linux\n\n![Linux screenshot](https://raw.githubusercontent.com/rhysd/ss/master/about-window/about-window-linux.png)\n\n### OS X\n\n![OS X screenshot](https://raw.githubusercontent.com/rhysd/ss/master/about-window/about-window-os-x.png)\n\n### Windows\n\n![Windows screenshot](https://raw.githubusercontent.com/rhysd/ss/master/about-window/about-window-windows.jpg)\n\n## License\n\n[MIT License](/LICENSE.txt).\n\n","funding_links":[],"categories":["TypeScript","Tools","Library"],"sub_categories":["For Electron","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysd%2Felectron-about-window","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhysd%2Felectron-about-window","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysd%2Felectron-about-window/lists"}