@zero-transfer/sftp
v0.4.7
Published
Zero-dependency SFTP over SSH with a first-party SSH transport stack.
Downloads
1,552
Readme
@zero-transfer/sftp
Zero-dependency SFTP over SSH with a first-party SSH transport stack.
Install
npm install @zero-transfer/sftpOverview
Zero-dependency SFTP over SSH built on a first-party SSH transport stack: Ed25519 / RSA-SHA2-256/512 / ECDSA P-256/384/521 host keys, password / keyboard-interactive / public-key (Ed25519 + RSA) auth, host-key pinning, OpenSSH known_hosts (hashed/plain, [host]:port, @revoked), handshake timeout, and idle NAT keepalive.
Usage
import {
createTransferClient,
uploadFile,
downloadFile,
createSftpProviderFactory,
} from "@zero-transfer/sftp";Public surface
This package publishes a narrowed surface of 8 exports. These symbols are also available from @zero-transfer/sdk; the table below links into the full API reference:
| Symbol | Kind | Notes |
| --------------------------------------------------------------------------------------------------------------------------------------- | --------- | ------------------ |
| createSftpProviderFactory | Function | See API reference. |
| SftpProviderOptions | Interface | See API reference. |
| SftpRawSession | Interface | See API reference. |
| matchKnownHosts | Function | See API reference. |
| matchKnownHostsEntry | Function | See API reference. |
| parseKnownHosts | Function | See API reference. |
| KnownHostsEntry | Interface | See API reference. |
| KnownHostsMarker | Type | See API reference. |
Examples
| Example | What it shows |
| ------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------- |
| examples/sftp-private-key.ts | SFTP private-key authentication example with host-key pinning. |
| examples/sftp-directory-ops.ts | SFTP directory operations: list, stat, mkdir, rename, remove, rmdir. |
Documentation
License
MIT © Tony Wiedman
