In the version 1.17.0 of the ssh2 package a new feature was added: mscdex/ssh2#1445
The feature adds support for passing an object of key-value variables when establishing a SFTP connection.
i.e. potentially a basic example would look like:
const config = {
host: 'arch-vbox',
port: 22,
username: 'tim',
password: 'xxxx',
env: { MY_VAR: "test value" }
};
const sftp = new Client();
sftp
.connect(config)
.then(() => {
return sftp.list(remoteDir);
});
Could support for this feature be added?