yoop 0.1.2 → 0.1.5
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.
- package/README.md +17 -1
- package/bin.js +70 -70
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -61,6 +61,19 @@ yoop clipboard receive A7K9
|
|
|
61
61
|
yoop clipboard sync
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
+
### Directory Sync
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Host a sync session
|
|
68
|
+
yoop sync ~/Projects/shared-folder
|
|
69
|
+
|
|
70
|
+
# Join a sync session
|
|
71
|
+
yoop sync A7K9 ~/Projects/shared-folder
|
|
72
|
+
|
|
73
|
+
# With exclusion patterns
|
|
74
|
+
yoop sync ./folder --exclude "*.log" --exclude "dist/"
|
|
75
|
+
```
|
|
76
|
+
|
|
64
77
|
## Features
|
|
65
78
|
|
|
66
79
|
- **Cross-platform**: Windows, Linux, and macOS
|
|
@@ -69,6 +82,7 @@ yoop clipboard sync
|
|
|
69
82
|
- **Private & secure**: TLS 1.3 encryption, data never leaves local network
|
|
70
83
|
- **Fast transfers**: Chunked transfers with verification
|
|
71
84
|
- **Resume capability**: Interrupted transfers resume automatically
|
|
85
|
+
- **Directory sync**: Real-time bidirectional folder synchronization
|
|
72
86
|
- **Web interface**: Browser-based UI for devices without CLI
|
|
73
87
|
|
|
74
88
|
## CLI Commands
|
|
@@ -78,7 +92,9 @@ yoop share <files...> # Share files/folders
|
|
|
78
92
|
yoop receive <code> # Receive with code
|
|
79
93
|
yoop clipboard share # Share clipboard
|
|
80
94
|
yoop clipboard receive <code> # Receive clipboard
|
|
81
|
-
yoop clipboard sync [code] # Bidirectional sync
|
|
95
|
+
yoop clipboard sync [code] # Bidirectional clipboard sync
|
|
96
|
+
yoop sync <directory> # Host a directory sync session
|
|
97
|
+
yoop sync <code> <directory> # Join a directory sync session
|
|
82
98
|
yoop scan # Scan for active shares
|
|
83
99
|
yoop web # Start web interface
|
|
84
100
|
yoop diagnose # Network diagnostics
|
package/bin.js
CHANGED
|
@@ -4,92 +4,92 @@ const { spawn } = require("child_process");
|
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* Platform to npm package name mapping
|
|
9
|
-
*/
|
|
10
7
|
const PLATFORMS = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
"linux-x64": {
|
|
9
|
+
packages: [
|
|
10
|
+
"@sanchxt/yoop-linux-x64-musl",
|
|
11
|
+
"@sanchxt/yoop-linux-x64-gnu",
|
|
12
|
+
],
|
|
13
|
+
},
|
|
14
|
+
"linux-arm64": {
|
|
15
|
+
packages: ["@sanchxt/yoop-linux-arm64-gnu"],
|
|
16
|
+
},
|
|
17
|
+
"darwin-x64": {
|
|
18
|
+
packages: ["@sanchxt/yoop-darwin-x64"],
|
|
19
|
+
},
|
|
20
|
+
"darwin-arm64": {
|
|
21
|
+
packages: ["@sanchxt/yoop-darwin-arm64"],
|
|
22
|
+
},
|
|
23
|
+
"win32-x64": {
|
|
24
|
+
packages: ["@sanchxt/yoop-win32-x64-msvc"],
|
|
25
|
+
},
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
* Find the binary path for the current platform
|
|
30
|
-
*/
|
|
31
28
|
function getBinaryPath() {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
const platform = process.platform;
|
|
30
|
+
const arch = process.arch;
|
|
31
|
+
const key = `${platform}-${arch}`;
|
|
35
32
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
const platformConfig = PLATFORMS[key];
|
|
34
|
+
if (!platformConfig) {
|
|
35
|
+
console.error(`Error: Unsupported platform: ${platform}-${arch}`);
|
|
36
|
+
console.error(
|
|
37
|
+
"Supported platforms: linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64"
|
|
38
|
+
);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
const binName = platform === "win32" ? "yoop.exe" : "yoop";
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
for (const packageName of platformConfig.packages) {
|
|
45
|
+
try {
|
|
46
|
+
const packagePath = require.resolve(`${packageName}/package.json`);
|
|
47
|
+
const binPath = path.join(
|
|
48
|
+
path.dirname(packagePath),
|
|
49
|
+
"bin",
|
|
50
|
+
binName
|
|
51
|
+
);
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
if (fs.existsSync(binPath)) {
|
|
54
|
+
return binPath;
|
|
55
|
+
}
|
|
56
|
+
} catch {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
57
59
|
}
|
|
58
|
-
}
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
console.error(`Error: Could not find yoop binary for ${platform}-${arch}`);
|
|
62
|
+
console.error("");
|
|
63
|
+
console.error(
|
|
64
|
+
"This usually means the platform-specific package failed to install."
|
|
65
|
+
);
|
|
66
|
+
console.error("Try reinstalling:");
|
|
67
|
+
console.error(" npm install -g yoop");
|
|
68
|
+
console.error("");
|
|
69
|
+
console.error("If the problem persists, please file an issue at:");
|
|
70
|
+
console.error(" https://github.com/sanchxt/yoop/issues");
|
|
71
|
+
process.exit(1);
|
|
69
72
|
}
|
|
70
73
|
|
|
71
|
-
/**
|
|
72
|
-
* Run the binary with the given arguments
|
|
73
|
-
*/
|
|
74
74
|
function run() {
|
|
75
|
-
|
|
75
|
+
const binPath = getBinaryPath();
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
const child = spawn(binPath, process.argv.slice(2), {
|
|
78
|
+
stdio: "inherit",
|
|
79
|
+
shell: false,
|
|
80
|
+
});
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
child.on("error", (err) => {
|
|
83
|
+
console.error(`Error: Failed to execute yoop: ${err.message}`);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
});
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
child.on("exit", (code, signal) => {
|
|
88
|
+
if (signal) {
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
process.exit(code ?? 0);
|
|
92
|
+
});
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
run();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yoop",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Cross-platform local network file sharing - transfer files between devices on the same network using simple codes",
|
|
5
5
|
"bin": {
|
|
6
6
|
"yoop": "bin.js"
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"node": ">=16"
|
|
34
34
|
},
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@sanchxt/yoop-linux-x64-gnu": "0.1.
|
|
37
|
-
"@sanchxt/yoop-linux-x64-musl": "0.1.
|
|
38
|
-
"@sanchxt/yoop-linux-arm64-gnu": "0.1.
|
|
39
|
-
"@sanchxt/yoop-darwin-x64": "0.1.
|
|
40
|
-
"@sanchxt/yoop-darwin-arm64": "0.1.
|
|
41
|
-
"@sanchxt/yoop-win32-x64-msvc": "0.1.
|
|
36
|
+
"@sanchxt/yoop-linux-x64-gnu": "0.1.5",
|
|
37
|
+
"@sanchxt/yoop-linux-x64-musl": "0.1.5",
|
|
38
|
+
"@sanchxt/yoop-linux-arm64-gnu": "0.1.5",
|
|
39
|
+
"@sanchxt/yoop-darwin-x64": "0.1.5",
|
|
40
|
+
"@sanchxt/yoop-darwin-arm64": "0.1.5",
|
|
41
|
+
"@sanchxt/yoop-win32-x64-msvc": "0.1.5"
|
|
42
42
|
}
|
|
43
43
|
}
|