{"_id":"@ascendedco/active-win","_rev":"1-1647f3cf6bbe8eed971eca62a279314d","name":"@ascendedco/active-win","dist-tags":{"latest":"6.1.1"},"versions":{"6.1.1":{"name":"@ascendedco/active-win","version":"6.1.1","description":"Get metadata about the active window (title, id, bounds, owner, URL, etc). Works on macOS, Linux, Windows.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/active-win.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd","build":"swift build --configuration=release && mv .build/release/active-win main","prepublishOnly":"npm run build"},"keywords":["macos","linux","windows","app","application","window","win","active","focused","current","title","name","id","pid","screenshot","capture","metadata","bounds","memory","usage","bundleid","browser","url","chrome","safari","edge","brave"],"devDependencies":{"ava":"^2.4.0","tsd":"^0.10.0","xo":"^0.25.3"},"optionalDependencies":{"ffi-napi":"^2.4.5","ref-napi":"^1.4.2","ref-wchar-napi":"^1.0.2","ref-struct-napi":"^1.1.0"},"gitHead":"430e6efc02823c1b04331a987012a519c360ab23","bugs":{"url":"https://github.com/sindresorhus/active-win/issues"},"homepage":"https://github.com/sindresorhus/active-win#readme","dependencies":{"ffi-napi":"^2.4.5","ref-napi":"^1.4.2","ref-wchar-napi":"^1.0.2","ref-struct-napi":"^1.1.0"},"_id":"@ascendedco/active-win@6.1.1","_nodeVersion":"12.17.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-DFnfle4aQusVLDR4cpTpq0+9RpaKEBTwXmt8ziZ68mqbZXZPaEN3GvVV+vXnLjkBiQycVt7ovY9vn46EszIbxg==","shasum":"5d9f4106c7f447ed813b2f7e7d83a30cc89e8167","tarball":"https://registry.npmjs.org/@ascendedco/active-win/-/active-win-6.1.1.tgz","fileCount":9,"unpackedSize":118436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe06+mCRA9TVsSAnZWagAAga8P/ieCRrJnnNWsGeYB2Mbh\n4MNMaFlSn53FHatHYtg3YdLEcK3FeYsbYgyHUUNmRDf/dd09frxQKua5/hiN\nOT0QC1cIn9Ne9VxqMMyRMj/7gG7nhp11bxxQyXBpj+8CJlEaexUh2Tp0cwA4\nfLB8Jt8+07jRNs/QAbJ7irZbGyXYIFgAUOlEdHHna2ct08CIVfKBTBA43HZR\nuWKv5eFB+5hP1G7bfxqvv0XmfMLe8U45Ew2/R6XookUGawkVWkTFr91DelF4\nepntREZsxQkFLrJJjv0pP621bBHme/HWQmo9yKaPgaf0HoFGEw2CK9sj2kuD\nOoG68eKaerAyBuCa5oRdtiFRr3pDQS5ED/XZAALDViS3DtQVxPMAnFWjtQGl\nD3fVrj5IWZ5ToLttQ8B28+RFmtx8LhkLJlH9odEcGvRLDWtMCWghhvZ2nkPf\n2QOU/v6sYIAmfNhHzrI5QtAJYOhdx8usB1ZVYREhlh2J/XFJlag7SuqoNyql\n8+CNf8HPdZ5aCB8xtIk6u+Dhpa4nRp7ntfb118zdJ20YYHWrZyesrldEog03\nsHKZFzd5ZFQbzM+9ngdSIMm7wlYHK5wi/p9yspCb9uBFDPxgvUXF8AKLeAaa\npO4cOj12SHYROxOJ54uk6Rb/T71MQ0CMmkgp7db5nVf0uBEks0Y3Aoap7ORX\nM7dc\r\n=bp7u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1qkHyROD33NkR67X3bbafeD8sovAlpHfNYGZnWN842QIgEIGjXuTqUH6xOa/ZI24Afdq6kZvsIP45MrK23Gocglo="}]},"maintainers":[{"name":"ascendedco","email":"christian@ascended.co.za"}],"_npmUser":{"name":"ascendedco","email":"christian@ascended.co.za"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/active-win_6.1.1_1590931365561_0.034366816876042705"},"_hasShrinkwrap":false}},"time":{"created":"2020-05-31T13:22:45.523Z","6.1.1":"2020-05-31T13:22:45.838Z","modified":"2022-04-04T15:42:58.593Z"},"maintainers":[{"name":"ascendedco","email":"christian@ascended.co.za"}],"description":"Get metadata about the active window (title, id, bounds, owner, URL, etc). Works on macOS, Linux, Windows.","homepage":"https://github.com/sindresorhus/active-win#readme","keywords":["macos","linux","windows","app","application","window","win","active","focused","current","title","name","id","pid","screenshot","capture","metadata","bounds","memory","usage","bundleid","browser","url","chrome","safari","edge","brave"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/active-win.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"bugs":{"url":"https://github.com/sindresorhus/active-win/issues"},"license":"MIT","readme":"# active-win [![Build Status](https://travis-ci.org/sindresorhus/active-win.svg?branch=master)](https://travis-ci.org/sindresorhus/active-win)\n\nGet metadata about the [active window](https://en.wikipedia.org/wiki/Active_window) (title, id, bounds, owner, URL, etc)\n\nWorks on macOS, Linux, Windows.\n\nUsers on macOS 10.13 or earlier needs to download the [Swift runtime support libraries](https://support.apple.com/kb/DL1998).\n\n## Install\n\n```\n$ npm install active-win\n```\n\n## Usage\n\n```js\nconst activeWin = require('active-win');\n\n(async () => {\n\tconsole.log(await activeWin());\n\t/*\n\t{\n\t\ttitle: 'Unicorns - Google Search',\n\t\tid: 5762,\n\t\tbounds: {\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\theight: 900,\n\t\t\twidth: 1440\n\t\t},\n\t\towner: {\n\t\t\tname: 'Google Chrome',\n\t\t\tprocessId: 310,\n\t\t\tbundleId: 'com.google.Chrome',\n\t\t\tpath: '/Applications/Google Chrome.app'\n\t\t},\n\t\turl: 'https://sindresorhus.com/unicorn',\n\t\tmemoryUsage: 11015432\n\t}\n\t*/\n})();\n```\n\n\n## API\n\n### activeWin()\n\nReturns a `Promise<Object>` with the result, or `Promise<undefined>` if there is no active window or if the information is not available.\n\n### activeWin.sync()\n\nReturns an `Object` with the result, or `undefined` if there is no active window.\n\n## Result\n\n- `platform` *(string)* - `'macos'` | `'linux'` | `'windows'`\n- `title` *(string)* - Window title\n- `id` *(number)* - Window identifier\n- `bounds` *(Object)* - Window position and size\n\t- `x` *(number)*\n\t- `y` *(number)*\n\t- `width` *(number)*\n\t- `height` *(number)*\n- `owner` *(Object)* - App that owns the window\n\t- `name` *(string)* - Name of the app\n\t- `processId` *(number)* - Process identifier\n\t- `bundleId` *(string)* - Bundle identifier *(macOS only)*\n\t- `path` *(string)* - Path to the app\n- `url` *(string?)* - URL of the active browser tab if the active window is Safari, Chrome, Edge, or Brave *(macOS only)*\n- `memoryUsage` *(number)* - Memory usage by the window owner process\n\n## OS support\n\nIt works on macOS, Linux, and Windows 7+.\n\n**Note**: On Windows, there isn't a clear notion of a \"Window ID\". Instead it returns the memory address of the window \"handle\" in the `id` property. That \"handle\" is unique per window, so it can be used to identify them. [Read more…](https://msdn.microsoft.com/en-us/library/windows/desktop/ms632597(v=vs.85).aspx#window_handle).\n\n## Related\n\n- [active-win-cli](https://github.com/sindresorhus/active-win-cli) - CLI for this module\n- [active-win-log](https://github.com/uglow/active-win-log) - Window-usage logging CLI using this module\n\n## Maintainers\n\n- [Sindre Sorhus](https://github.com/sindresorhus)\n- [Sebastián Ramírez](https://github.com/tiangolo)\n","readmeFilename":"readme.md"}