electron-about
Version:
Simple standalone about window for Electron.
98 lines (63 loc) • 1.71 kB
Markdown
<p align="center">
<img src="resources/demo.png" width=284 alt="Demo">
</p>
Simple standalone about window for Electron.
```sh
npm install --save electron-about
```
Adding an about window to your app is now as simple as calling a single function:
```ts
import * as path from 'path';
import About from 'electron-about';
function getMyAppMenu () {
return [
{
label: 'Notable',
submenu: [
About.makeMenuItem ( 'Notable', {
icon: `file://${path.join ( __static, 'images', 'icon.png' )}`,
appName: 'Notable',
version: 'Version 1.7.3',
copyright: '© Fabio Spampinato'
})
// Other menu items...
]
}
// Other menu items...
];
}
```
If you want more fine-grined control a few more advanced methods are provided.
The following types are provided:
```ts
type Options = {
icon: string,
appName: string,
version: string,
copyright: string
};
```
The following methods are provided:
The current about window, if any.
Focus to the current about window.
Returns a boolean indicating whether the about window is open or not.
Focus to the current about window, or create one and focus to it.
Close the current about window.
Open or close the about window.
Make a menu item which opens the about window.
Make the HTML which will be loaded into the about window.
Override this method to have custom content in your about window.
MIT © Fabio Spampinato