@ozzyczech/ftpsync 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.
Files changed (3) hide show
  1. package/README.md +38 -0
  2. package/bin/ftpsync.js +43 -0
  3. package/package.json +40 -0
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # @ozzyczech/ftpsync
2
+
3
+ Hash-based deploy over FTPS without SSH — a single static binary, distributed
4
+ as a native npm package. Only the binary for your platform is downloaded (via
5
+ per-platform `optionalDependencies`); there is no post-install download step.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g @ozzyczech/ftpsync
11
+ # or run without installing:
12
+ npx @ozzyczech/ftpsync --help
13
+ ```
14
+
15
+ The installed command is `ftpsync`.
16
+
17
+ ## Usage
18
+
19
+ ```bash
20
+ ftpsync --server ftp.example.com --username deploy --server-dir /www
21
+ ```
22
+
23
+ See the full documentation, options, and CI/CD recipes at
24
+ **https://github.com/OzzyCzech/ftpsync**.
25
+
26
+ ## Supported platforms
27
+
28
+ | OS | Arch | Package |
29
+ |---|---|---|
30
+ | Linux | x64 | `@ozzyczech/ftpsync-linux-x64` |
31
+ | Linux | arm64 | `@ozzyczech/ftpsync-linux-arm64` |
32
+ | macOS | x64 | `@ozzyczech/ftpsync-darwin-x64` |
33
+ | macOS | arm64 | `@ozzyczech/ftpsync-darwin-arm64` |
34
+ | Windows | x64 | `@ozzyczech/ftpsync-win32-x64` |
35
+
36
+ ## License
37
+
38
+ MIT
package/bin/ftpsync.js ADDED
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ // Thin launcher: resolve the prebuilt binary from the matching platform package
5
+ // (installed via optionalDependencies) and exec it, forwarding args/stdio/exit code.
6
+
7
+ const { spawnSync } = require("node:child_process");
8
+
9
+ function resolveBinary() {
10
+ const { platform, arch } = process;
11
+ const pkg = `@ozzyczech/ftpsync-${platform}-${arch}`;
12
+ const exe = platform === "win32" ? "ftpsync.exe" : "ftpsync";
13
+ try {
14
+ return require.resolve(`${pkg}/bin/${exe}`);
15
+ } catch {
16
+ throw new Error(
17
+ `ftpsync: no prebuilt binary for ${platform}-${arch}.\n` +
18
+ `Expected the optional dependency "${pkg}" to be installed.\n` +
19
+ `If your platform is unsupported, build from source: https://github.com/OzzyCzech/ftpsync`,
20
+ );
21
+ }
22
+ }
23
+
24
+ let binary;
25
+ try {
26
+ binary = resolveBinary();
27
+ } catch (err) {
28
+ console.error(err.message);
29
+ process.exit(1);
30
+ }
31
+
32
+ const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
33
+
34
+ if (result.error) {
35
+ console.error(`ftpsync: failed to launch binary: ${result.error.message}`);
36
+ process.exit(1);
37
+ }
38
+ // Re-raise the binary's terminating signal, otherwise exit with its code.
39
+ if (result.signal) {
40
+ process.kill(process.pid, result.signal);
41
+ } else {
42
+ process.exit(result.status ?? 0);
43
+ }
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@ozzyczech/ftpsync",
3
+ "version": "0.1.0",
4
+ "description": "Hash-based deploy over FTPS without SSH — a single static binary, distributed as a native npm package.",
5
+ "bin": {
6
+ "ftpsync": "bin/ftpsync.js"
7
+ },
8
+ "files": [
9
+ "bin/ftpsync.js"
10
+ ],
11
+ "keywords": [
12
+ "ftp",
13
+ "ftps",
14
+ "deploy",
15
+ "deployment",
16
+ "sync",
17
+ "ci",
18
+ "upload",
19
+ "cli"
20
+ ],
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/OzzyCzech/ftpsync.git"
24
+ },
25
+ "homepage": "https://github.com/OzzyCzech/ftpsync#readme",
26
+ "bugs": {
27
+ "url": "https://github.com/OzzyCzech/ftpsync/issues"
28
+ },
29
+ "license": "MIT",
30
+ "engines": {
31
+ "node": ">=18"
32
+ },
33
+ "optionalDependencies": {
34
+ "@ozzyczech/ftpsync-linux-x64": "0.1.0",
35
+ "@ozzyczech/ftpsync-linux-arm64": "0.1.0",
36
+ "@ozzyczech/ftpsync-darwin-x64": "0.1.0",
37
+ "@ozzyczech/ftpsync-darwin-arm64": "0.1.0",
38
+ "@ozzyczech/ftpsync-win32-x64": "0.1.0"
39
+ }
40
+ }