Miss any of our Open RFC calls?Watch the recordings here! »

electron-menu

1.0.0 • Public • Published

electron-menu

npm travis standard

Convenience module to build Electron menus templates.

Install

npm install --save electron-menu

Usage

converts this:

const em = require('electron-menu')
 
const menu = em(['Coins', [
  ['Bitcoin', bitcoinClick],
  ['Litecoin', litecoinClick],
  ['Tokens', [
    ['Omni', omniClick],
    ['Counterparty', 'Cmd+H', bitcoinClick],
    '-',
    ['Example role', 'hide']
  ]]
]])

to

{
  label: 'Coins',
  submenu: [
    { label: 'Bitcoin', click: bitcoinClick },
    { label: 'Litecoin', click: litecoinClick },
    { label: 'Tokens', submenu: [
      { label: 'Omni', click: omniClick },
      { label: 'Counterparty', accelerator: 'Cmd+H', click: bitcoinClick },
      { type: 'separator' },
      { label: 'Example role', role: 'hide' }
    ]}
  ]
}

License

Copyright JP Richardson

MIT

Keywords

Install

npm i electron-menu

DownloadsWeekly Downloads

439

Version

1.0.0

License

MIT

Last publish

Collaborators

  • avatar