scp-next 1.1.6 → 1.1.7
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
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[![docs][docs-image]][docs-url]
|
|
8
8
|
|
|
9
9
|
[npm-image]: https://img.shields.io/npm/v/scp-next
|
|
10
|
-
[npm-url]: https://npmjs.
|
|
10
|
+
[npm-url]: https://www.npmjs.com/package/scp-next
|
|
11
11
|
[license-image]: https://img.shields.io/npm/l/scp-next
|
|
12
12
|
[license-url]: https://github.com/chengchuu/scp-next
|
|
13
13
|
[node-image]: https://img.shields.io/node/v/scp-next
|
|
@@ -15,21 +15,12 @@
|
|
|
15
15
|
[docs-image]: https://img.shields.io/badge/docs-GitHub%20Pages-2b6cb0
|
|
16
16
|
[docs-url]: https://chengchuu.github.io/scp-next/
|
|
17
17
|
|
|
18
|
-
`scp-next` is an SCP-style
|
|
19
|
-
|
|
20
|
-
Developer documentation is available at [GitHub Pages](https://chengchuu.github.io/scp-next/).
|
|
21
|
-
Use the [interactive examples](https://chengchuu.github.io/scp-next/examples/) to generate
|
|
22
|
-
CLI and TypeScript transfer snippets, or browse the
|
|
23
|
-
[API documentation](https://chengchuu.github.io/scp-next/api/).
|
|
24
|
-
|
|
25
|
-
## Features
|
|
18
|
+
`scp-next` is an SCP-style CLI and library for secure SSH file transfers. It uses SFTP through
|
|
19
|
+
`ssh2-sftp-client` rather than implementing SCP or SFTP directly.
|
|
26
20
|
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
- JSON configuration files, named profiles, and configured jobs.
|
|
31
|
-
- Reusable transfer client.
|
|
32
|
-
- Optional sequential remote commands after a successful upload.
|
|
21
|
+
Read the [documentation](https://chengchuu.github.io/scp-next/), generate CLI snippets with the
|
|
22
|
+
[interactive examples](https://chengchuu.github.io/scp-next/examples/), or browse the
|
|
23
|
+
[API documentation](https://chengchuu.github.io/scp-next/api/).
|
|
33
24
|
|
|
34
25
|
## Contents
|
|
35
26
|
|
|
@@ -86,7 +77,7 @@ Downloading: /var/log/example.log 1.0 MB / 1.0 MB (100%)
|
|
|
86
77
|
```
|
|
87
78
|
|
|
88
79
|
Password arguments are convenient, but they may be exposed through shell history and process listings.
|
|
89
|
-
Prefer `SCP_NEXT_PASSWORD` environment variable in shared or production environments. For key authentication, use a protected private-key file.
|
|
80
|
+
Prefer the `SCP_NEXT_PASSWORD` environment variable in shared or production environments. For key authentication, use a protected private-key file.
|
|
90
81
|
|
|
91
82
|
Use the library:
|
|
92
83
|
|
|
@@ -122,7 +113,9 @@ CLI commands use `<source> <destination>`. Programmatic upload and download APIs
|
|
|
122
113
|
| Upload | Local | Remote |
|
|
123
114
|
| Download | Remote | Local |
|
|
124
115
|
|
|
125
|
-
Destination paths follow familiar `cp`/`scp` behavior. If the destination exists as a directory or
|
|
116
|
+
Destination paths follow familiar `cp`/`scp` behavior. If the destination exists as a directory or
|
|
117
|
+
ends with a path separator, `scp-next` places the source inside that directory using the source
|
|
118
|
+
basename. Missing destination directories are created by default.
|
|
126
119
|
|
|
127
120
|
### Upload Examples
|
|
128
121
|
|
|
@@ -162,7 +155,7 @@ scp-next upload ./dist /var/www/example \
|
|
|
162
155
|
|
|
163
156
|
`--post-upload-command` is repeatable and upload-only. Commands run sequentially on the
|
|
164
157
|
remote server with the SSH user's permissions. The first non-zero exit code stops the sequence
|
|
165
|
-
and
|
|
158
|
+
and causes the CLI to exit with a nonzero status. A missing exit status is also treated as failure.
|
|
166
159
|
|
|
167
160
|
Use an encrypted private key:
|
|
168
161
|
|
|
@@ -325,7 +318,7 @@ await upload({
|
|
|
325
318
|
| `port` | server | SSH server port. Defaults to `22`. |
|
|
326
319
|
| `username` | server | SSH username. |
|
|
327
320
|
| `password` | server | SSH password. |
|
|
328
|
-
| `privateKey` | server | Private-key content as a string or Buffer
|
|
321
|
+
| `privateKey` | server | Private-key content as a string or a `Buffer`. |
|
|
329
322
|
| `privateKeyFile` | server | Private-key file path. |
|
|
330
323
|
| `passphrase` | server | Passphrase for an encrypted private key. |
|
|
331
324
|
| `agent` | server | SSH agent socket path. |
|
|
@@ -342,7 +335,7 @@ await upload({
|
|
|
342
335
|
| `onProgress` | transfer | Progress callback for file and directory transfers. |
|
|
343
336
|
|
|
344
337
|
`client.exec(command, options)` returns `ExecResult` with `stdout`, `stderr`, `exitCode`,
|
|
345
|
-
and an optional signal
|
|
338
|
+
and an optional `signal`. Its optional `timeout` is command-specific; `failOnStderr` can treat
|
|
346
339
|
stderr output as failure even when the exit code is zero. `maxBuffer` limits combined captured
|
|
347
340
|
output and defaults to 10 MiB. A timeout closes the SSH channel; whether the remote process is
|
|
348
341
|
terminated depends on the SSH server.
|
|
@@ -351,7 +344,8 @@ terminated depends on the SSH server.
|
|
|
351
344
|
|
|
352
345
|
### Configuration Files
|
|
353
346
|
|
|
354
|
-
Use `scp-next.config.json` in the current directory. `scp-next` also auto-detects these rc-style
|
|
347
|
+
Use `scp-next.config.json` in the current directory. `scp-next` also auto-detects these rc-style
|
|
348
|
+
filenames: `.scp-nextrc` and `.scp-nextrc.json`.
|
|
355
349
|
|
|
356
350
|
```text
|
|
357
351
|
scp-next.config.json
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scp-next",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "An SCP CLI and library for secure SSH file transfers using SFTP.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
},
|
|
75
75
|
"homepage": "https://chengchuu.github.io/scp-next/",
|
|
76
76
|
"engines": {
|
|
77
|
-
"node": ">=18.
|
|
77
|
+
"node": ">=18.20.4"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"commander": "^12.1.0",
|
|
File without changes
|