menus
Version:
Menus app using Electron
93 lines (56 loc) • 1.69 kB
Markdown
A short-hand for you to build something like:
<img src="./media/preview.png" width="400" alt="preview">
```bash
$ npm install --save menus
```
```js
const Menus = require('menus')
const menus = new Menus()
menus.setMenu([
{
label: 'My First Menu Item',
click() {
console.log('clicked!')
}
}
])
menus.start()
menus.on('ready', () => {
console.log('Menus app is ready!')
})
```
For a more complete example, please check out [example]('./example/index.js').
```js
const menus = new Menus()
```
Path to tray icon.
Default: `false`
Whether to show dock icon.
Default: `''`
The tooltip to show when tray icon is hovered.
Emitted when a tray is created on the menubar.
Set context menu for the tray icon. The doc of menu is [here](https://github.com/electron/electron/blob/master/docs/api/menu.md).
Bootstrap the menus app.
The electron.app instance.
The created tray instance.
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D
[](https://egoist.mit-license.org/) © [EGOIST](https://github.com/egoist)