{"id":18687357,"url":"https://github.com/junosuarez/tray-windows","last_synced_at":"2025-04-12T05:27:14.859Z","repository":{"id":31366804,"uuid":"34929760","full_name":"junosuarez/tray-windows","owner":"junosuarez","description":"npm module to create system tray apps on Windows","archived":false,"fork":false,"pushed_at":"2015-08-03T17:17:19.000Z","size":136,"stargazers_count":18,"open_issues_count":3,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T15:36:38.449Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","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/junosuarez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-02T00:09:30.000Z","updated_at":"2022-02-19T08:46:51.000Z","dependencies_parsed_at":"2022-08-24T14:21:51.865Z","dependency_job_id":null,"html_url":"https://github.com/junosuarez/tray-windows","commit_stats":null,"previous_names":["jden/tray-windows"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junosuarez%2Ftray-windows","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junosuarez%2Ftray-windows/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junosuarez%2Ftray-windows/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junosuarez%2Ftray-windows/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junosuarez","download_url":"https://codeload.github.com/junosuarez/tray-windows/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248521401,"owners_count":21118065,"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-11-07T10:32:32.283Z","updated_at":"2025-04-12T05:27:14.827Z","avatar_url":"https://github.com/junosuarez.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tray-windows\nnpm module to create system tray apps on Windows\n\n## Installation\n```\n\u003e npm install --save tray-windows\n```\n\n\n## Usage\nSee `example.js` for more\n```js\nvar tray = require('tray-windows')\n\ntray({\n  name: 'Tooltip title',\n  items: ['A','B','C'],\n  icon: tray.icons.green()\n}, function (err, app) {\n  if (err) { throw err }\n\n  app.on('click:menuItem', function (item) {\n    console.log(item)\n    // {index: 0, text: 'A'}\n  })\n\n  app.addMenuItem('D')\n  app.delMenuItem('B')\n  app.delMenuItemAt(1) // 0-based index\n  app.dropMenu() // remove all menu items\n  app.exit() // close the tray app; node still running\n\n  app.updateIcon(tray.icons.red())\n})\n```\n\n\n## Icons\nIcons should be Buffers of 20x20 PNGs (alpha ok).\nBasic icons are included for the following colors:\n\nTray.icons.red()\nTray.icons.yellow()\nTray.icons.green()\nTray.icons.black()\nTray.icons.white()\nTray.icons.grey()\n\nThe PSD used to produce these icons is included in the git repo in `icons/icon.psd`\n\n\n## Compatibility\nThis module was inspired by [tray](https://github.com/brandonhorst/node-tray) for OS X. If you're trying to\nwrite something that will work cross-platform, you can try the compatibility layer:\n\n```js\nvar createTray = require('tray-windows/compat')\nvar createApp = function (cb) {\n  // since `native-app`is only for OSX, we don't depend on it-\n  // this function isn't needed, but shown here mocked out\n  // to use the example code\n  cb(null, null)\n}\n\n// sample taken verbatim from `tray` readme:\n\ncreateApp(function (err, app) {\n  createTray(app, function (err, tray) {\n    tray.specify({\n      title: 'Hello, world!',\n      menuItems: [\n        {title: 'Informational'},\n        {\n          title: 'Do something',\n          shortcut: 'x',\n          action: function () { console.log('You pressed a menuItem!') }\n        }\n      ]\n    })\n  })\n})\n\n```\n\n## Requirements\n\n- Node\n- Windows\n- .Net 4.5+\n\nTested on Windows 8 x64. If you try another configuration, please let me know in an issue if it worked or not.\n\n\n## Contributing\n\nContributions welcome! Please see CONTRIBUTING.md\n\n- jden \u003cjason@denizac.org\u003e\n\n## License\n\n(c) MMXV jden. ISC License. See LICENSE.md.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunosuarez%2Ftray-windows","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunosuarez%2Ftray-windows","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunosuarez%2Ftray-windows/lists"}