@zero-transfer/ftp 0.4.2 → 0.4.6
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 +13 -5
- package/dist/index.cjs +15 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +12 -6
- package/dist/index.d.ts +12 -6
- package/dist/index.mjs +14 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
npm install @zero-transfer/ftp
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
Installing this package automatically pulls in [`@zero-transfer/core`](https://www.npmjs.com/package/@zero-transfer/core) as a transitive dependency. The full core surface (`createTransferClient`, `uploadFile`, `downloadFile`, profiles, errors, sync planner, …) is re-exported from this package, so a single `import { … } from "@zero-transfer/ftp"` is all you need. If your app uses multiple protocols, install the umbrella [`@zero-transfer/sdk`](https://www.npmjs.com/package/@zero-transfer/sdk) instead of multiple scoped packages.
|
|
12
|
+
|
|
11
13
|
## Overview
|
|
12
14
|
|
|
13
15
|
Plain FTP with EPSV/PASV streaming, REST-resume, MLST/MLSD listings, Unix LIST fallback, and full profile timeout enforcement. Use `createFtpProviderFactory()`.
|
|
@@ -15,7 +17,12 @@ Plain FTP with EPSV/PASV streaming, REST-resume, MLST/MLSD listings, Unix LIST f
|
|
|
15
17
|
## Usage
|
|
16
18
|
|
|
17
19
|
```ts
|
|
18
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
createTransferClient,
|
|
22
|
+
uploadFile,
|
|
23
|
+
downloadFile,
|
|
24
|
+
createFtpProviderFactory,
|
|
25
|
+
} from "@zero-transfer/ftp";
|
|
19
26
|
```
|
|
20
27
|
|
|
21
28
|
## Public surface
|
|
@@ -41,10 +48,11 @@ This package publishes a narrowed surface of **14** exports. These symbols are a
|
|
|
41
48
|
|
|
42
49
|
## Examples
|
|
43
50
|
|
|
44
|
-
| Example
|
|
45
|
-
|
|
|
46
|
-
| [`examples/ftp-basic.ts`](https://github.com/tonywied17/zero-transfer/blob/main/examples/ftp-basic.ts)
|
|
47
|
-
| [`examples/
|
|
51
|
+
| Example | What it shows |
|
|
52
|
+
| ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
53
|
+
| [`examples/ftp-basic.ts`](https://github.com/tonywied17/zero-transfer/blob/main/examples/ftp-basic.ts) | Basic FTP upload + download example. |
|
|
54
|
+
| [`examples/ftp-directory-ops.ts`](https://github.com/tonywied17/zero-transfer/blob/main/examples/ftp-directory-ops.ts) | FTP directory operations: list, stat, mkdir, rename, remove, rmdir. |
|
|
55
|
+
| [`examples/transfer-queue.ts`](https://github.com/tonywied17/zero-transfer/blob/main/examples/transfer-queue.ts) | Transfer queue with concurrency, progress, and per-job receipts. |
|
|
48
56
|
|
|
49
57
|
## Documentation
|
|
50
58
|
|
package/dist/index.cjs
CHANGED
|
@@ -84,6 +84,7 @@ __export(ftp_exports, {
|
|
|
84
84
|
importOpenSshConfig: () => importOpenSshConfig,
|
|
85
85
|
importWinScpSessions: () => importWinScpSessions,
|
|
86
86
|
isClassicProviderId: () => isClassicProviderId,
|
|
87
|
+
isMainModule: () => isMainModule,
|
|
87
88
|
isSensitiveKey: () => isSensitiveKey,
|
|
88
89
|
joinRemotePath: () => joinRemotePath,
|
|
89
90
|
matchKnownHosts: () => matchKnownHosts,
|
|
@@ -4899,6 +4900,19 @@ function isModifiedAtDifferent2(source, destination, toleranceMs) {
|
|
|
4899
4900
|
return Math.abs(sourceTime - destinationTime) > toleranceMs;
|
|
4900
4901
|
}
|
|
4901
4902
|
|
|
4903
|
+
// src/utils/mainModule.ts
|
|
4904
|
+
var import_node_url = require("url");
|
|
4905
|
+
function isMainModule(importMetaUrl) {
|
|
4906
|
+
if (typeof process === "undefined" || !process.argv || process.argv.length < 2) {
|
|
4907
|
+
return false;
|
|
4908
|
+
}
|
|
4909
|
+
try {
|
|
4910
|
+
return process.argv[1] === (0, import_node_url.fileURLToPath)(importMetaUrl);
|
|
4911
|
+
} catch {
|
|
4912
|
+
return false;
|
|
4913
|
+
}
|
|
4914
|
+
}
|
|
4915
|
+
|
|
4902
4916
|
// src/providers/classic/ftp/FtpProvider.ts
|
|
4903
4917
|
var import_node_buffer6 = require("buffer");
|
|
4904
4918
|
var import_node_net = require("net");
|
|
@@ -6601,6 +6615,7 @@ function normalizeFeatureLines(input) {
|
|
|
6601
6615
|
importOpenSshConfig,
|
|
6602
6616
|
importWinScpSessions,
|
|
6603
6617
|
isClassicProviderId,
|
|
6618
|
+
isMainModule,
|
|
6604
6619
|
isSensitiveKey,
|
|
6605
6620
|
joinRemotePath,
|
|
6606
6621
|
matchKnownHosts,
|