1.0.5 • Published 4 months ago

nv-cli-ssh v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

nv-cli-ssh

  • ssh client for cli-tools
  • currently only cd , pwd, ls support result format
  • other output/rslt formatter exist in nv-shell-parser

install

  • npm install nv-cli-ssh

splitted

usage

  const x   = require("nv-cli-ssh");

example

login

 var r = await x.login_with_name_and_passwd("aaa.bbb.com","the-username","the-password")

cd

 await r.cd("/upload");
 r.pwd() ; // /upload 

ls

    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'
}
> 

METHODS

    fetch(cmd, input_fmt=(r)=>r, output_fmt=(r)=>r)
    

    r._ainit                r._arecv                r._asend                r._fetch                r._quit                 
    
    r.c_  r.streams_

APIS

	{
	  creat: [AsyncFunction: creat],
	  login_with_name_and_passwd: [AsyncFunction: login_with_name_and_passwd]
	}

LICENSE

  • ISC