{"id":13798036,"url":"https://github.com/jenslind/electron-positioner","last_synced_at":"2025-04-05T03:09:52.152Z","repository":{"id":36505585,"uuid":"40811270","full_name":"jenslind/electron-positioner","owner":"jenslind","description":":pushpin: Helps positioning your electron windows.","archived":false,"fork":false,"pushed_at":"2019-08-24T22:03:48.000Z","size":34,"stargazers_count":243,"open_issues_count":2,"forks_count":19,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T02:05:58.700Z","etag":null,"topics":["electron"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenslind.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-16T10:47:43.000Z","updated_at":"2025-02-15T06:34:28.000Z","dependencies_parsed_at":"2022-09-06T02:11:47.887Z","dependency_job_id":null,"html_url":"https://github.com/jenslind/electron-positioner","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenslind%2Felectron-positioner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenslind%2Felectron-positioner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenslind%2Felectron-positioner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenslind%2Felectron-positioner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenslind","download_url":"https://codeload.github.com/jenslind/electron-positioner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280272,"owners_count":20912967,"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":["electron"],"created_at":"2024-08-04T00:00:38.127Z","updated_at":"2025-04-05T03:09:52.137Z","avatar_url":"https://github.com/jenslind.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Library","Tools"],"sub_categories":["Position/Size","For Electron"],"readme":"# Electron-positioner [![Build Status](https://travis-ci.org/jenslind/electron-positioner.svg?branch=master)](https://travis-ci.org/jenslind/electron-positioner) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)\n\u003e Helps positioning your electron windows.\n\n## Install\n```\nnpm install --save electron-positioner\n```\n\n## Usage\n```Javascript\nvar Positioner = require('electron-positioner')\nvar positioner = new Positioner(browserWindow)\n\n// Moves the window top right on the screen.\npositioner.move('topRight')\n\n// Returns `{x,y}`\npositioner.calculate('trayCenter', trayBounds)\n```\n\nNote, `trayBounds` is only required with the positions that starts with `tray`.\n\n\n## Docs\n\n#### new Positioner (browserWindow)\nConstructor\n\n##### BrowserWindow\nThe [BrowserWindow](https://github.com/atom/electron/blob/master/docs/api/browser-window.md) instance.\n\n#### calculate (position, trayBounds)\nReturns coordinates `{x,y}`.\n\n#### move (position, trayBounds)\nMoves the window with `BrowserWindow.setPosition()`\n\n##### position\nA string telling where to place the window.\nAllowed values:\n- `trayLeft`\n- `trayBottomLeft`\n- `trayRight`\n- `trayBottomRight`\n- `trayCenter`\n- `trayBottomCenter`\n- `topLeft`\n- `topRight`\n- `bottomLeft`\n- `bottomRight`\n- `topCenter`\n- `bottomCenter`\n- `leftCenter`\n- `rightCenter`\n- `center`\n\n##### trayBounds\nTray bounds, only needed for the following positions:\n- `trayLeft`\n- `trayBottomLeft`\n- `trayRight`\n- `trayBottomRight`\n- `trayCenter`\n- `trayBottomCenter`\n\n## Tests\n```\nnpm test\n```\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenslind%2Felectron-positioner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenslind%2Felectron-positioner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenslind%2Felectron-positioner/lists"}