yoop 0.1.0
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 +112 -0
- package/bin.js +95 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Yoop
|
|
2
|
+
|
|
3
|
+
**Cross-Platform Local Network File Sharing**
|
|
4
|
+
|
|
5
|
+
Yoop enables seamless peer-to-peer file transfers over local networks using simple, time-limited codes. Unlike cloud-based solutions, all data stays on your local network, ensuring privacy, speed, and zero bandwidth costs.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# npm
|
|
11
|
+
npm install -g yoop
|
|
12
|
+
|
|
13
|
+
# pnpm
|
|
14
|
+
pnpm add -g yoop
|
|
15
|
+
|
|
16
|
+
# yarn
|
|
17
|
+
yarn global add yoop
|
|
18
|
+
|
|
19
|
+
# bun
|
|
20
|
+
bun add -g yoop
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
### Share Files
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# Share a single file
|
|
29
|
+
yoop share document.pdf
|
|
30
|
+
|
|
31
|
+
# Share multiple files and folders
|
|
32
|
+
yoop share photos/ videos/ notes.md
|
|
33
|
+
|
|
34
|
+
# Share with custom expiration
|
|
35
|
+
yoop share project.zip --expire 10m
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Receive Files
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Receive using the 4-character code
|
|
42
|
+
yoop receive A7K9
|
|
43
|
+
|
|
44
|
+
# Receive to specific directory
|
|
45
|
+
yoop receive A7K9 --output ~/Downloads/
|
|
46
|
+
|
|
47
|
+
# Batch mode (auto-accept)
|
|
48
|
+
yoop receive A7K9 --batch
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Clipboard Sharing
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Share current clipboard content
|
|
55
|
+
yoop clipboard share
|
|
56
|
+
|
|
57
|
+
# Receive clipboard content
|
|
58
|
+
yoop clipboard receive A7K9
|
|
59
|
+
|
|
60
|
+
# Bidirectional clipboard sync
|
|
61
|
+
yoop clipboard sync
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Features
|
|
65
|
+
|
|
66
|
+
- **Cross-platform**: Windows, Linux, and macOS
|
|
67
|
+
- **No account required**: Zero configuration, no cloud dependency
|
|
68
|
+
- **Simple 4-character codes**: Easy discovery without IP addresses
|
|
69
|
+
- **Private & secure**: TLS 1.3 encryption, data never leaves local network
|
|
70
|
+
- **Fast transfers**: Chunked transfers with verification
|
|
71
|
+
- **Resume capability**: Interrupted transfers resume automatically
|
|
72
|
+
- **Web interface**: Browser-based UI for devices without CLI
|
|
73
|
+
|
|
74
|
+
## CLI Commands
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
yoop share <files...> # Share files/folders
|
|
78
|
+
yoop receive <code> # Receive with code
|
|
79
|
+
yoop clipboard share # Share clipboard
|
|
80
|
+
yoop clipboard receive <code> # Receive clipboard
|
|
81
|
+
yoop clipboard sync [code] # Bidirectional sync
|
|
82
|
+
yoop scan # Scan for active shares
|
|
83
|
+
yoop web # Start web interface
|
|
84
|
+
yoop diagnose # Network diagnostics
|
|
85
|
+
yoop history # View transfer history
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## How It Works
|
|
89
|
+
|
|
90
|
+
1. **Sender** shares files and gets a 4-character code (e.g., `A7K9`)
|
|
91
|
+
2. **Receiver** enters the code on their device
|
|
92
|
+
3. **Discovery** via UDP broadcast + mDNS on local network
|
|
93
|
+
4. **Transfer** over TLS 1.3 encrypted connection
|
|
94
|
+
5. **Resume** automatic resumption of interrupted transfers
|
|
95
|
+
|
|
96
|
+
## Supported Platforms
|
|
97
|
+
|
|
98
|
+
| Platform | Architecture |
|
|
99
|
+
|----------|--------------|
|
|
100
|
+
| Linux | x64, ARM64 |
|
|
101
|
+
| macOS | x64 (Intel), ARM64 (Apple Silicon) |
|
|
102
|
+
| Windows | x64 |
|
|
103
|
+
|
|
104
|
+
## Links
|
|
105
|
+
|
|
106
|
+
- [GitHub Repository](https://github.com/sanchxt/yoop)
|
|
107
|
+
- [Documentation](https://github.com/sanchxt/yoop#readme)
|
|
108
|
+
- [Issue Tracker](https://github.com/sanchxt/yoop/issues)
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
MIT OR Apache-2.0
|
package/bin.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Platform to npm package name mapping
|
|
9
|
+
*/
|
|
10
|
+
const PLATFORMS = {
|
|
11
|
+
"linux-x64": {
|
|
12
|
+
packages: ["@sanchxt/yoop-linux-x64-musl", "@sanchxt/yoop-linux-x64-gnu"],
|
|
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
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Find the binary path for the current platform
|
|
30
|
+
*/
|
|
31
|
+
function getBinaryPath() {
|
|
32
|
+
const platform = process.platform;
|
|
33
|
+
const arch = process.arch;
|
|
34
|
+
const key = `${platform}-${arch}`;
|
|
35
|
+
|
|
36
|
+
const platformConfig = PLATFORMS[key];
|
|
37
|
+
if (!platformConfig) {
|
|
38
|
+
console.error(`Error: Unsupported platform: ${platform}-${arch}`);
|
|
39
|
+
console.error("Supported platforms: linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64");
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const binName = platform === "win32" ? "yoop.exe" : "yoop";
|
|
44
|
+
|
|
45
|
+
// Try each package in order (musl first for Linux, as it's more portable)
|
|
46
|
+
for (const packageName of platformConfig.packages) {
|
|
47
|
+
try {
|
|
48
|
+
const packagePath = require.resolve(`${packageName}/package.json`);
|
|
49
|
+
const binPath = path.join(path.dirname(packagePath), "bin", binName);
|
|
50
|
+
|
|
51
|
+
if (fs.existsSync(binPath)) {
|
|
52
|
+
return binPath;
|
|
53
|
+
}
|
|
54
|
+
} catch {
|
|
55
|
+
// Package not installed, try next
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
console.error(`Error: Could not find yoop binary for ${platform}-${arch}`);
|
|
61
|
+
console.error("");
|
|
62
|
+
console.error("This usually means the platform-specific package failed to install.");
|
|
63
|
+
console.error("Try reinstalling:");
|
|
64
|
+
console.error(" npm install -g yoop");
|
|
65
|
+
console.error("");
|
|
66
|
+
console.error("If the problem persists, please file an issue at:");
|
|
67
|
+
console.error(" https://github.com/sanchxt/yoop/issues");
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Run the binary with the given arguments
|
|
73
|
+
*/
|
|
74
|
+
function run() {
|
|
75
|
+
const binPath = getBinaryPath();
|
|
76
|
+
|
|
77
|
+
const child = spawn(binPath, process.argv.slice(2), {
|
|
78
|
+
stdio: "inherit",
|
|
79
|
+
shell: false,
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
child.on("error", (err) => {
|
|
83
|
+
console.error(`Error: Failed to execute yoop: ${err.message}`);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
child.on("exit", (code, signal) => {
|
|
88
|
+
if (signal) {
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
process.exit(code ?? 0);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
run();
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "yoop",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Cross-platform local network file sharing - transfer files between devices on the same network using simple codes",
|
|
5
|
+
"bin": {
|
|
6
|
+
"yoop": "bin.js"
|
|
7
|
+
},
|
|
8
|
+
"main": "bin.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"bin.js"
|
|
11
|
+
],
|
|
12
|
+
"keywords": [
|
|
13
|
+
"file-sharing",
|
|
14
|
+
"local-network",
|
|
15
|
+
"file-transfer",
|
|
16
|
+
"lan",
|
|
17
|
+
"airdrop",
|
|
18
|
+
"cross-platform",
|
|
19
|
+
"p2p",
|
|
20
|
+
"cli"
|
|
21
|
+
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/sanchxt/yoop.git"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/sanchxt/yoop#readme",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/sanchxt/yoop/issues"
|
|
29
|
+
},
|
|
30
|
+
"author": "sanchxt",
|
|
31
|
+
"license": "MIT OR Apache-2.0",
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=16"
|
|
34
|
+
},
|
|
35
|
+
"optionalDependencies": {
|
|
36
|
+
"@sanchxt/yoop-linux-x64-gnu": "0.1.0",
|
|
37
|
+
"@sanchxt/yoop-linux-x64-musl": "0.1.0",
|
|
38
|
+
"@sanchxt/yoop-linux-arm64-gnu": "0.1.0",
|
|
39
|
+
"@sanchxt/yoop-darwin-x64": "0.1.0",
|
|
40
|
+
"@sanchxt/yoop-darwin-arm64": "0.1.0",
|
|
41
|
+
"@sanchxt/yoop-win32-x64-msvc": "0.1.0"
|
|
42
|
+
}
|
|
43
|
+
}
|