active-win
Get the title / window id / app name / process ID of the active window (macOS, Linux and Windows)
Notice
This package is here for development and testing purposes. Please use the official version.
Install
$ npm install --save active-win
Usage
const activeWin = require('active-win');
activeWin().then(result => {
console.log(result);
});
API
activeWin()
Returns a Promise
for the result Object
.
activeWin.sync()
Returns the result Object
.
Result
title
- Window titleid
- Window ID (in macOS and Linux)app
- App owning the windowpid
- Process ID of the app owning the window
Operating system support
It works with macOS, Linux and Windows 7+.
Note: In Windows, there isn't a clear notion of a "Window ID". So, when used in Windows, it returns the memory address of the window "handle" in the id
property of the object, that "handle" is unique per window, so it can be used to identify them. To learn more about it refer to the official Windows documentation.
Related
License
MIT © Sindre Sorhus