1.0.2 • Published 1 year ago

@ramu_actyv/better-sftp v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Installation

npm install @ramu_actyv/better-sftp

Basic Usage

const { SFTP } =  require("@ramu_actyv/better-sftp");

const sftpClient = new SFTP();

const options = {
  host: '127.0.0.1',
  port: 22, // sftp
  username: 'username',
  password: '******'
};
async function sftpInteraction() {
  try {
    const client = await sftpClient.connect(options);
    const list = await sftpClient.list(client, "/pathname");
    sftpClient.disconnect(client);
  } catch (error: any) {
    throw new Error(error);
  }
}

sftpInteraction();