clidownloadmanager 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +30 -2
- package/bin/clidownloadmanager.js +70 -0
- package/package.json +44 -4
- package/vendor/linux-x64/CLIDownloadManager +0 -0
- package/vendor/win32-x64/CLIDownloadManager.exe +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Leynier Hidalgo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
-
#
|
|
1
|
+
# clidownloadmanager (npm wrapper)
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This package bundles the prebuilt native **CLIDownloadManager** binaries, so
|
|
4
|
+
`npm install` does not compile Rust, install Cargo, or download from GitHub.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npm install -g clidownloadmanager
|
|
8
|
+
clidownloadmanager --help
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Supported in this package version:
|
|
12
|
+
|
|
13
|
+
- Linux x86_64 (static musl binary)
|
|
14
|
+
- Windows x86_64
|
|
15
|
+
|
|
16
|
+
macOS is not bundled yet; the launcher prints a source-build link. The main
|
|
17
|
+
native installers (`install.sh` / `install.ps1`) and the project documentation
|
|
18
|
+
live at:
|
|
19
|
+
|
|
20
|
+
<https://github.com/LeynierHidalgo/CLIDownloadManager>
|
|
21
|
+
|
|
22
|
+
## What this package is
|
|
23
|
+
|
|
24
|
+
A thin Node launcher plus the native binaries. The actual download engine is
|
|
25
|
+
the same Rust program as the standalone release; npm is only a distribution
|
|
26
|
+
channel. It does not add a Node runtime to the application itself.
|
|
27
|
+
|
|
28
|
+
## Binaries and licenses
|
|
29
|
+
|
|
30
|
+
The bundled binaries come from the GitHub release matching this package
|
|
31
|
+
version. The project is MIT-licensed; see `LICENSE`.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// Launcher for the native CLIDownloadManager binary bundled in this package.
|
|
5
|
+
// npm shims execute this file; it replaces itself with the real executable so
|
|
6
|
+
// the ratatui interface gets a real terminal attached.
|
|
7
|
+
|
|
8
|
+
const fs = require("fs");
|
|
9
|
+
const path = require("path");
|
|
10
|
+
const { spawn } = require("child_process");
|
|
11
|
+
|
|
12
|
+
const REPO = "https://github.com/LeynierHidalgo/CLIDownloadManager";
|
|
13
|
+
|
|
14
|
+
function fail(message) {
|
|
15
|
+
process.stderr.write(`clidownloadmanager: ${message}\n`);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const platform = process.platform;
|
|
20
|
+
const arch = process.arch;
|
|
21
|
+
|
|
22
|
+
let directory;
|
|
23
|
+
let binaryName;
|
|
24
|
+
if (platform === "linux" && arch === "x64") {
|
|
25
|
+
directory = "linux-x64";
|
|
26
|
+
binaryName = "CLIDownloadManager";
|
|
27
|
+
} else if (platform === "win32" && arch === "x64") {
|
|
28
|
+
directory = "win32-x64";
|
|
29
|
+
binaryName = "CLIDownloadManager.exe";
|
|
30
|
+
} else if (platform === "darwin") {
|
|
31
|
+
fail(
|
|
32
|
+
`no prebuilt macOS binary is bundled yet (${arch}). ` +
|
|
33
|
+
`Build from source instead: ${REPO}#installation`,
|
|
34
|
+
);
|
|
35
|
+
} else {
|
|
36
|
+
fail(
|
|
37
|
+
`no prebuilt binary for ${platform}/${arch}. ` +
|
|
38
|
+
`Supported: linux-x64, win32-x64. See ${REPO}#installation`,
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const binary = path.join(__dirname, "..", "vendor", directory, binaryName);
|
|
43
|
+
if (!fs.existsSync(binary)) {
|
|
44
|
+
fail(
|
|
45
|
+
`the bundled binary ${path.relative(process.cwd(), binary)} is missing. ` +
|
|
46
|
+
`Reinstall the package or build from source: ${REPO}#installation`,
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (platform !== "win32") {
|
|
51
|
+
try {
|
|
52
|
+
fs.chmodSync(binary, 0o755);
|
|
53
|
+
} catch {
|
|
54
|
+
// Best effort; the package should already have the executable bit.
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const child = spawn(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
59
|
+
|
|
60
|
+
child.on("error", (error) => {
|
|
61
|
+
fail(`could not start the native binary: ${error.message}`);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
child.on("exit", (code, signal) => {
|
|
65
|
+
if (signal) {
|
|
66
|
+
process.kill(process.pid, signal);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
process.exit(code === null ? 1 : code);
|
|
70
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clidownloadmanager",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "A cross-platform terminal download manager with segmented, resumable downloads.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"clidownloadmanager": "bin/clidownloadmanager.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin/",
|
|
10
|
+
"vendor/",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=16"
|
|
16
|
+
},
|
|
17
|
+
"os": [
|
|
18
|
+
"linux",
|
|
19
|
+
"win32"
|
|
20
|
+
],
|
|
21
|
+
"cpu": [
|
|
22
|
+
"x64"
|
|
23
|
+
],
|
|
24
|
+
"keywords": [
|
|
25
|
+
"download-manager",
|
|
26
|
+
"tui",
|
|
27
|
+
"cli",
|
|
28
|
+
"http",
|
|
29
|
+
"resumable",
|
|
30
|
+
"segmented",
|
|
31
|
+
"rust"
|
|
32
|
+
],
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"author": "Leynier Hidalgo <leynier770@gmail.com>",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/LeynierHidalgo/CLIDownloadManager.git"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/LeynierHidalgo/CLIDownloadManager#readme",
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/LeynierHidalgo/CLIDownloadManager/issues"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
Binary file
|
|
Binary file
|