@crosscopy/clipboard 0.1.6 → 0.1.8

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 (2) hide show
  1. package/README.md +5 -20
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # General Clipboard Listener
2
2
 
3
3
  > A Cross-Platform clipboard listener that listens for both text and image (screenshots).
4
+ > Designed for NodeJS, not for web.
5
+ > Provides API to read and write text/image from/to clipboard.
4
6
 
5
- npm package: https://www.npmjs.com/package/general-clipboard-listener
7
+ npm package: https://www.npmjs.com/package/@crosscopy/clipboard
6
8
 
7
9
  ## Installation
8
10
 
@@ -51,25 +53,6 @@ console.log(clipboard.readTextSync());
51
53
  }, 10000);
52
54
  ```
53
55
 
54
- ### Note
55
-
56
- This is an important note. If you write some data and read it immediately using the `sync` APIs, you may not be able to get the data.
57
- It needs a tiny bit of time to process. any code between the two lines should work, such as `console.log()`.
58
-
59
- Here I use `await sleep(1)` to make it work.
60
-
61
- ```js
62
- const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));
63
-
64
- cb.writeTextSync("abc");
65
- await sleep(1);
66
- const text = cb.readTextSync();
67
- ```
68
-
69
- If this package becomes popular some day and people requires a fix, I will fix it. For now, this implementation is good enough for CrossCopy.
70
-
71
- I never need to write and read immediately after unless during testing.
72
-
73
56
  ## Explanation
74
57
 
75
58
  It's achieved using child process + `stdout`.
@@ -99,6 +82,8 @@ If your nodejs gives different platform or arch, it may not work.
99
82
 
100
83
  Cross Compile doesn't work due to some CGO problem. Have to build on different platforms manually.
101
84
 
85
+ Within `go-clipboard` folder.
86
+
102
87
  ```bash
103
88
  go build -o binaries/go-clipboard-darwin-arm64
104
89
  go build -o binaries/go-clipboard-darwin-x64
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crosscopy/clipboard",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Cross Platform Clipboard listener that detects both text and image update in clipboard",
5
5
  "source": "index.ts",
6
6
  "types": "./dist/index.d.ts",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "repository": {
16
16
  "type": "git",
17
- "url": "git+https://github.com/HuakunShen/general-clipboard-listener.git"
17
+ "url": "git+https://github.com/CrossCopy/clipboard.git"
18
18
  },
19
19
  "keywords": [
20
20
  "clipboard"
@@ -22,9 +22,9 @@
22
22
  "author": "Huakun Shen",
23
23
  "license": "ISC",
24
24
  "bugs": {
25
- "url": "https://github.com/HuakunShen/general-clipboard-listener/issues"
25
+ "url": "https://github.com/CrossCopy/clipboard/issues"
26
26
  },
27
- "homepage": "https://github.com/HuakunShen/general-clipboard-listener#readme",
27
+ "homepage": "https://github.com/CrossCopy/clipboard#readme",
28
28
  "dependencies": {},
29
29
  "devDependencies": {
30
30
  "@jest/globals": "^29.3.1",