@miniben90/x-win 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +2 -2
  2. package/README.md +24 -12
  3. package/index.js +7 -1
  4. package/package.json +25 -13
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022 BENKHADRA Hocine
3
+ Copyright (c) 2023 BENKHADRA Hocine
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
package/README.md CHANGED
@@ -4,13 +4,10 @@
4
4
 
5
5
  # @miniben90/x-win
6
6
 
7
- > This project work with Rust and napi-rs to make easy to have active window or an array of open windows.
8
- > It work with Microsoft Windows (10, 11), Linux (With Xserver) and Macos(*).
7
+ This project uses Rust and napi-rs to make it easy to obtain the active window or an array of open windows. It works on Microsoft Windows (10, 11), [Linux (with X server)](#linux), and [macOS](#darwin).
9
8
 
10
9
  ## How to install
11
10
 
12
- Easy to install:
13
-
14
11
  ```sh
15
12
  # With npm
16
13
  npm i @miniben90/x-win
@@ -21,9 +18,10 @@ yarn add @miniben90/x-win
21
18
 
22
19
  ## How to use
23
20
 
24
- ### Get information of current active window
21
+ ### Get information about the currently active window
25
22
 
26
23
  `exemple.ts`:
24
+
27
25
  ```typescript
28
26
  import { activeWindow, type WindowInfo } from '@miniben90/x-win';
29
27
 
@@ -33,7 +31,8 @@ console.log(currentWindow);
33
31
  ```
34
32
 
35
33
  `response`:
36
- ```json
34
+
35
+ ```javascript
37
36
  {
38
37
  id: 26148,
39
38
  info: {
@@ -56,9 +55,10 @@ console.log(currentWindow);
56
55
  }
57
56
  ```
58
57
 
59
- ### Get List of open windows with informations
58
+ ### Get a list of open windows with information
60
59
 
61
60
  `exemple.ts`:
61
+
62
62
  ```typescript
63
63
  import { openWindows, type WindowInfo } from '@miniben90/x-win';
64
64
 
@@ -68,7 +68,8 @@ console.log(windows);
68
68
  ```
69
69
 
70
70
  `response`:
71
- ```json
71
+
72
+ ```javascript
72
73
  [{
73
74
  id: 26148,
74
75
  info: {
@@ -91,15 +92,26 @@ console.log(windows);
91
92
  }]
92
93
  ```
93
94
 
95
+ # Linux
96
+
97
+ > Dependencies are required to be installed for development purposes.
98
+
99
+ ```sh
100
+ sudo apt install libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb-shm0-dev
101
+ ```
102
+
103
+ # Darwin
94
104
 
95
- ## For Darwin
105
+ ## Screen recording permission introduced in macOS 10.15 Catalina
96
106
 
97
- > ### Record screen required for macos
98
- > Macos require to grant access for recording screen. If your project don't have it the title will have `<unknown>` as value.
107
+ > macOS requires you to grant access for screen recording. If your project does not have it, the title will display `<unknown>` as its value.
99
108
 
100
109
  <hr class="padding-top: 30px;padding-bottom:30px">
101
110
 
102
- **This project was inspired by:**
111
+ # Project References
112
+
113
+ **Project Inspirations:**
114
+
103
115
  * [active-win](https://github.com/sindresorhus/active-win)
104
116
  * [active-win-pos-rs](https://github.com/dimusic/active-win-pos-rs)
105
117
  * This project was generated with [@napi-rs/cli](https://github.com/napi-rs)
package/index.js CHANGED
@@ -1,3 +1,9 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /* prettier-ignore */
4
+
5
+ /* auto-generated by NAPI-RS */
6
+
1
7
  const { existsSync, readFileSync } = require('fs')
2
8
  const { join } = require('path')
3
9
 
@@ -249,4 +255,4 @@ if (!nativeBinding) {
249
255
  const { activeWindow, openWindows } = nativeBinding
250
256
 
251
257
  module.exports.activeWindow = activeWindow
252
- module.exports.openWindows = openWindows
258
+ module.exports.openWindows = openWindows
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@miniben90/x-win",
3
- "version": "0.3.0",
3
+ "description": "This package allows you to retrieve precise information about active and open windows on Windows, MacOS, and Linux. You can obtain the position, size, title, and other memory of windows.",
4
+ "version": "0.4.1",
4
5
  "main": "index.js",
5
6
  "types": "index.d.ts",
6
7
  "files": [
@@ -13,9 +14,9 @@
13
14
  "name": "x-win",
14
15
  "triples": {
15
16
  "additional": [
17
+ "aarch64-apple-darwin",
16
18
  "aarch64-pc-windows-msvc",
17
19
  "i686-pc-windows-msvc",
18
- "aarch64-apple-darwin",
19
20
  "universal-apple-darwin"
20
21
  ]
21
22
  }
@@ -27,15 +28,27 @@
27
28
  },
28
29
  "repository": "https://github.com/miniben-90/x-win.git",
29
30
  "license": "MIT",
31
+ "keywords": [
32
+ "active",
33
+ "window",
34
+ "windows",
35
+ "active-window",
36
+ "active",
37
+ "current",
38
+ "position",
39
+ "title",
40
+ "list",
41
+ "open"
42
+ ],
30
43
  "devDependencies": {
31
- "@napi-rs/cli": "^2.14.5",
44
+ "@napi-rs/cli": "^2.15.2",
32
45
  "ava": "^5.1.1"
33
46
  },
34
47
  "ava": {
35
48
  "timeout": "3m"
36
49
  },
37
50
  "engines": {
38
- "node": ">= 10"
51
+ "node": ">= 14"
39
52
  },
40
53
  "scripts": {
41
54
  "artifacts": "napi artifacts",
@@ -46,15 +59,14 @@
46
59
  "universal": "napi universal",
47
60
  "version": "napi version"
48
61
  },
49
- "packageManager": "yarn@3.3.1",
50
- "description": "Get position, size, title and a few other properties of the active or open window(s) on Windows, MacOS and Linux.",
62
+ "packageManager": "yarn@3.5.0",
51
63
  "optionalDependencies": {
52
- "@miniben90/x-win-win32-x64-msvc": "0.3.0",
53
- "@miniben90/x-win-darwin-x64": "0.3.0",
54
- "@miniben90/x-win-linux-x64-gnu": "0.3.0",
55
- "@miniben90/x-win-win32-arm64-msvc": "0.3.0",
56
- "@miniben90/x-win-win32-ia32-msvc": "0.3.0",
57
- "@miniben90/x-win-darwin-arm64": "0.3.0",
58
- "@miniben90/x-win-darwin-universal": "0.3.0"
64
+ "@miniben90/x-win-win32-x64-msvc": "0.4.1",
65
+ "@miniben90/x-win-darwin-x64": "0.4.1",
66
+ "@miniben90/x-win-linux-x64-gnu": "0.4.1",
67
+ "@miniben90/x-win-darwin-arm64": "0.4.1",
68
+ "@miniben90/x-win-win32-arm64-msvc": "0.4.1",
69
+ "@miniben90/x-win-win32-ia32-msvc": "0.4.1",
70
+ "@miniben90/x-win-darwin-universal": "0.4.1"
59
71
  }
60
72
  }