- ssh client for cli-tools
- currently only cd , pwd, ls support result format
- other output/rslt formatter exist in nv-shell-parser
const x = require("nv-cli-ssh");
var r = await x.login_with_name_and_passwd("aaa.bbb.com","the-username","the-password")
await r.cd("/upload");
r.pwd() ; // /upload
var rslt = await r.ls();
> rslt.detail.length
183
> rslt.brief
{ total: 9035488 }
> rslt.detail[0]
{
type: 'dir',
permission: {
user: { read: true, write: true, exec: true },
group: { read: true, write: false, exec: true },
others: { read: true, write: false, exec: true }
},
hard_link_cnt: 7,
owner: 'root',
group: 'root',
bytsz: 12288,
date: 2001-01-07T12:15:00.000Z,
path: '/upload'
}
>
> rslt.detail[182]
{
type: 'file',
permission: {
user: { read: true, write: true, exec: false },
group: { read: true, write: false, exec: false },
others: { read: true, write: false, exec: false }
},
hard_link_cnt: 1,
owner: 'root',
group: 'root',
bytsz: 252,
date: 2022-06-24T00:00:00.000Z,
path: '/upload/bakup.xz'
}
>
fetch(cmd, input_fmt=(r)=>r, output_fmt=(r)=>r)
r._ainit r._arecv r._asend r._fetch r._quit
r.c_ r.streams_
{
creat: [AsyncFunction: creat],
login_with_name_and_passwd: [AsyncFunction: login_with_name_and_passwd]
}