{"id":17651323,"url":"https://github.com/nash403/electron-wendy","last_synced_at":"2026-05-09T00:35:49.512Z","repository":{"id":57221975,"uuid":"79795132","full_name":"nash403/electron-wendy","owner":"nash403","description":"A window manager for your Electron apps !","archived":false,"fork":false,"pushed_at":"2017-02-02T08:48:28.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T02:37:03.120Z","etag":null,"topics":["dialog","electron","manager","windows"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/nash403.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-23T10:40:25.000Z","updated_at":"2017-02-01T19:20:09.000Z","dependencies_parsed_at":"2022-08-31T08:31:26.964Z","dependency_job_id":null,"html_url":"https://github.com/nash403/electron-wendy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nash403%2Felectron-wendy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nash403%2Felectron-wendy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nash403%2Felectron-wendy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nash403%2Felectron-wendy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nash403","download_url":"https://codeload.github.com/nash403/electron-wendy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246296615,"owners_count":20754635,"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":["dialog","electron","manager","windows"],"created_at":"2024-10-23T11:41:46.533Z","updated_at":"2026-05-09T00:35:44.477Z","avatar_url":"https://github.com/nash403.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"electron-wendy\n===\nA window manager for your Electron apps !\n\nInstallation\n---\n  \n  `npm i --save electron-wendy` or `git clone https://github.com/nash403/electron-wendy.git`\n\nUsage\n---\n### TL;DR:\n`Wendy` is a window manager for Electron that provides convenient methods to create, remove, replace or give names to windows/modals.\n\nWith Wendy you can create and show a window at the same time and even pass argument to the new window in a single call:\n\n```js\nconst { app } = require('electron')\nconst path = require('path')\nconst Wendy = require('electron-wendy')\napp.on('ready', () =\u003e {\n  const mainWindow = Wendy.create('mainWin', {\n    showNow: true,\n    showPath: path.resolve(__dirname, '..', 'some-location', 'index.html'),\n    showArgs: { data: 'hello' }\n  }) // this creates a window called 'mainWin' and shows it. window.__args__ will then be populated in the new window\n})\n\n/**\n  * To show the window immediately at creation, the property 'showNow' must be set to true,\n  * otherwise you need to call showUrl on the returned instance.\n  */\n```\n\nThis package relies on the simple but powerful package [electron-window](https://github.com/jprichardson/electron-window). You can go and see their repo for more informations.\n\n### API Fields\n#### windows\nObject that keeps track of all windows created by Wendy.\n\n### API Methods\n\n#### create([name], [options])\nClass method that creates a new BrowserWindow with the following default options: { show: false, width:600, height:400 }.\n\n#### createModal(parent, [name], [options])\nCreates a modal window whose parent window is `parent`. Properties `name` and and `options` are optional and same as for create except that default width is now 400 and height is 250.\n\n#### createModalWithResponse(parent, eventName, [name], [options])\nSame as above except that you must give an `eventName` that is used to transfer the response data from the modal to the parent window.\n\nIn the modal window, when you are finished and need to emit the response, send via ipcRenderer a message with your data to the channel provided as argument above. Then in the parent window (with window instance, not with ipcRenderer !!), listen for an event on that channel.\n\nExample:\n\n```js\n// in the renderer process of the parent window\nconst Wendy = require('electron-wendy')\ndocument.getElementById('modalise-btn').onclick = function () {\n  let thisWindow = require('electron').remote.getCurrentWindow()\n  let modal = Wendy.createModalWithResponse(thisWindow,'some-channel-name')\n  thisWindow.once('some-channel-name', (...response) =\u003e {\n    console.log('your response is here !', ...response)\n  })\n}\n\n// in the renderer process of your modal\ndocument.getElementById('close-btn').onclick = function () {\n  require('electron').ipcRenderer.send('some-channel-name',{data:'some data 1'}, {status:'some data 2'})\n  window.close() // You should always close the modal after emitting your result\n}\n```\n\n#### getName(win)\nRetrieves the name of the given window or `null` if not found\n\n#### getByName(name)\nGets the window named by the given parameter.\n\n**Note:** If you have stored a reference to a window created with Wendy you can check the name at the property *winName*.\n\n#### getById(id)\nGets the window whose id is the given parameter or `null` if not found\n\n#### has(name)\nTests if Wendy is currenty managing a window named by the given parameter. Returns `true` or `false`.\n\n#### add(win, [name])\nIf you somehow have a window instance created without Wendy, you can add it to Wendy with this method.\n\n#### remove(win)\nRemoves the given window from Wendy.\n\n#### replace(name, newWindowOptions)\nRemoves a window whose name is `name` and creates a new one with the same name. `newWindowOptions` are the same as the *create* method.\n\n#### on(evName, callback), once(evName, callback), off(evName, callback)\nWendy has a `emitter` property that is a Node.js [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter). With these methods you can register and unregister events with Wendy.\n\n#### emit(evName, options, [...args])\nEmits events through the `emmitter` property of Wendy.\n\n* `options` is an object you can set with the following properties:\n  - `options.emittedBy`: `BrowserWindow` instance that initiated the event.\n  - `options.target`: `string` or `BrowserWindow` that represents the target window for this event.\n* `...args` is a set of argument that can be passed through this event.\n\n### Methods in the created BrowserWindow instance\n#### showUrl(indexPath, [someArgs], [callback])\nShows the url. When the url is finished loading, the callback is returned. If the optional argsForRenderer is set then __args__ will be a global object for the page in the renderer process. This is a convenient way to pass arguments from the main process to the renderer process.\n\n**Note :** All other methods available in [electron-window](https://github.com/jprichardson/electron-window) are also available in the instance returned by Wendy.\n\n### Native dialogs\nWendy also provides links to the Electron native functions for dialogs (`showOpenDialog`, `showSaveDialog`, `showMessageBox` and `showErrorBox`). You can read the related doc [here](http://electron.atom.io/docs/api/dialog/).\n\n\n\nLicense\n---\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnash403%2Felectron-wendy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnash403%2Felectron-wendy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnash403%2Felectron-wendy/lists"}