mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-10 17:57:04 +00:00
* Add rmdir() to type definition. * Bump version number in comment header. * Remove patch level version number to fix tests * Update tests to include an rmdir() invocation.
29 lines
902 B
TypeScript
29 lines
902 B
TypeScript
import * as Client from 'ssh2-sftp-client';
|
|
import * as fs from 'fs';
|
|
const client = new Client();
|
|
|
|
client.connect({
|
|
host: 'asdb',
|
|
port: 1234,
|
|
privateKey: 'my private key rsa in openssh format',
|
|
readyTimeout: 1000,
|
|
}).then(() => null);
|
|
|
|
client.list('/remote/path').then(() => null);
|
|
|
|
client.get('/remote/path').then(stream => stream.read(0));
|
|
client.get('/remote/path', true, 'binary').then(stream => stream.read(0));
|
|
|
|
client.put('/local/path', '/remote/path').then(() => null);
|
|
client.put(new Buffer('content'), '/remote/path').then(() => null);
|
|
client.put(fs.createReadStream('Hello World'), '/remote/path').then(() => null);
|
|
|
|
client.mkdir('/remote/path/dir', true).then(() => null);
|
|
client.rmdir('/remote/path/dir', true).then(() => null);
|
|
|
|
client.delete('remote/path').then(() => null);
|
|
|
|
client.rename('/remote/from', '/remote/to').then(() => null);
|
|
|
|
client.end().then(() => null);
|