async function uploadData(client, buf, remotePath) {
  try {
    console.log(`Uploading data to ${remotePath}`);
    let rs = new Readable();
    rs.push(buf);
    rs.push(null);
    let rslt = await client.put(rs, remotePath);
    console.log(`Result: ${rslt}`);
    // verify file was created
    let fileStat = await client.stat(remotePath);
    console.log(`File Stat: ${JSON.stringify(fileStat, null, ' ')}`);
  } catch (err) {
    throw new Error(`uploadData: ${err.message}`);
  }
}
Upload a buffer of data to a remote file on sftp server.
We define this as a separate function because we want to separate it
from connecting because connecting is a very slow process and we may want
to upload more than one buffer of data. We don't want to make a new connection
for every upload as that would be much slower